Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal positional arguments support in just for shell like nushell etc. #1651

Closed
vincent-herlemont opened this issue Jul 25, 2023 · 1 comment

Comments

@vincent-herlemont
Copy link

vincent-herlemont commented Jul 25, 2023

Related issues:

I am currently integrating just with nushell, and I'm experiencing a roadblock with the handling of positional arguments. As of now, it appears that nushell lacks support for this functionality.

Here is a snippet of my current Justfile:

set shell := ["nu", "-c"]

test_command *args='':
    echo $1

Regrettably, this format isn't compatible with nushell. I am proposing a feature where we could retrieve positional arguments similar to how it's done in bash or other traditional shells. The idea is to use a syntax (Variables and Substitution) like {{1}}, {{2}}, etc. to represent positional arguments equivalent to $1, $2, etc.

A proposed usage might look like:

set shell := ["nu", "-c"]

test_command *args='':
    echo {{1}}

This implementation would greatly aid those of us utilizing just in conjunction with nushell and maybe others. Tell me your opinion on this proposal? Maybe I could try my hand at an MR.

@casey
Copy link
Owner

casey commented Aug 2, 2023

This should work if you add set positional-arguments, which causes positional arguments to be passed to each command

set positional-arguments
set shell := ["nu", "-c"]

foo *args='':
    echo $1

Please feel free to reopen if that doesn't work!

@casey casey closed this as completed Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants