question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue 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:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
BentoumiTechcommented, Aug 14, 2020

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 with cmd is the possibility to merge args from the global workspace which is an edge case that most users wouldn’t need.

0reactions
jsejcksncommented, Aug 14, 2020

You also lose the ability to restrict permissions when using cmd instead of args.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found