Add option: args
See original GitHub issueIssue Type
- Feature Request
Add a new args
string array property to workspace.globals
and workspace.scripts[scriptName]
.
This would allow default arguments to be appended to the interpolated command. Here are some examples:
Script:
scripts:
develop:
file: main.ts
args:
- hello
globals:
deno_options:
allow-read: true
> denox run develop
# equal to:
# deno run --allow-read main.ts hello
> denox run develop more args
# equal to:
# deno run --allow-read main.ts hello more args
Global:
scripts:
develop:
file: main.ts
globals:
args:
- foo bar
- baz
deno_options:
allow-read: true
> denox run develop
# equal to:
# deno run --allow-read main.ts "foo bar" baz
> denox run develop more args
# equal to:
# deno run --allow-read main.ts "foo bar" baz more args
Both: (script replaces global, like with deno_options
)
scripts:
develop:
file: main.ts
args:
- nice to
- meet you
globals:
args:
- foo bar
- baz
deno_options:
allow-read: true
> denox run develop
# equal to:
# deno run --allow-read main.ts "nice to" "meet you"
> denox run develop more args
# equal to:
# deno run --allow-read main.ts "nice to" "meet you" more args
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Using Python Optional Arguments When Defining Functions
In this section, you'll learn how to define a function that takes an optional argument. Functions with optional arguments offer more flexibility in...
Read more >python - How do I define a function with optional arguments?
Just use the *args parameter, which allows you to pass as many arguments as you want after your a,b,c . You would have...
Read more >argparse — Parser for command-line options, arguments and ...
The ArgumentParser object will hold all the information necessary to parse the command line into Python data types. Adding arguments¶. Filling an ArgumentParser ......
Read more >Python Optional Arguments: A How-To Guide - Career Karma
Optional arguments are arguments that do not need a value. On Career Karma, learn how to accept optional arguments in a Python function....
Read more >Adding arguments and options to your Bash scripts - Red Hat
The ability to use positional parameters—otherwise known as arguments—to specify data to be used as values for variables in the scripts is one ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Definitely I agree with you.
I’ll go ahead with first implementing the
cmd
.I may reconsider
args
in the future, the only possibility that I see with args that wouldn’t be possible withcmd
is the possibility to mergeargs
from theglobal
workspace which is an edge case that most users wouldn’t need.You also lose the ability to restrict permissions when using
cmd
instead ofargs
.