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

moss/cli: add -D and -y global arguments #9

Merged
merged 1 commit into from Sep 11, 2023

Conversation

GZGavinZhao
Copy link
Contributor

@GZGavinZhao GZGavinZhao commented Sep 11, 2023

cargo run -p moss -- -h:

Next generation package manager

Usage: moss [OPTIONS] [COMMAND]

Commands:
  extract  Extract a `.stone` content to disk
  info     Query packages
  inspect  Examine raw stone files
  install  Install packages
  list     List packages
  remove   Remove packages
  version  Display version and exit
  help     Print this message or the help of the given subcommand(s)

Options:
  -v, --version           
  -D, --directory <root>  Root directory [default: /]
  -y, --yes-all           Assume yes for all questions
  -h, --help              Print help

cargo run -p moss -- install -h:

Install packages

Usage: moss install [OPTIONS]

Options:
  -D, --directory <root>  Root directory [default: /]
  -y, --yes-all           Assume yes for all questions
  -h, --help              Print help (see more with '--help')

To obtain the value, use something like:

let root = args.get_one::<String>("root").unwrap().clone();
let yes = args.get_flag("yes");

Signed-off-by: Gavin Zhao <git@gzgz.dev>
@ikeycode
Copy link
Member

LGTM! Thanks

@ikeycode ikeycode merged commit 3527766 into serpent-os:main Sep 11, 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

Successfully merging this pull request may close these issues.

None yet

2 participants