Skip to content

Commit

Permalink
Correctly map requirements and user-pref settings
Browse files Browse the repository at this point in the history
The SharedSettings class used a different name than the cli arguments
  • Loading branch information
MHendricks committed Sep 27, 2023
1 parent 8fb459a commit 27084d5
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions hab/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ def get_command(self, ctx, name):
@click.option(
"-r",
"--requirement",
"forced_requirements",
callback=SharedSettings.set_ctx_instance,
multiple=True,
help="Forces this distro requirement ignoring normally resolved requirements. Using "
Expand All @@ -414,29 +415,20 @@ def get_command(self, ctx, name):
)
@click.option(
"--prefs/--no-prefs",
"enable_user_prefs",
callback=SharedSettings.set_ctx_instance,
default=None,
help="If you don't pass a URI, allow looking it up from user prefs.",
)
@click.option(
"--save-prefs/--no-save-prefs",
"enable_user_prefs_save",
callback=SharedSettings.set_ctx_instance,
default=None,
help="Update the uri stored in prefs if the uri is provided.",
)
@click.pass_context
def _cli(
ctx,
site_paths,
verbosity,
script_dir,
script_ext,
prereleases,
requirement,
dump_scripts,
prefs,
save_prefs,
):
def _cli(ctx, **kargs):
# Note: Using the `set_ctx_instance` callback on the options prevents
# the need to process anything inside of this function.
pass
Expand Down

0 comments on commit 27084d5

Please sign in to comment.