mirror of
https://github.com/Mic92/nix-update.git
synced 2024-09-11 10:35:43 +03:00
improve --help output, notably '--version' possibilities
This commit is contained in:
parent
c690b76213
commit
6f21bf4db4
@ -65,7 +65,8 @@ def parse_args(args: list[str]) -> Options:
|
||||
"--shell", action="store_true", help="provide a shell with the package"
|
||||
)
|
||||
parser.add_argument(
|
||||
"--version", nargs="?", help="Version to update to", default="stable"
|
||||
"--version", nargs="?", default=VersionPreference.STABLE,
|
||||
help="Version to update to. Possible values are: " + ', '.join(VersionPreference),
|
||||
)
|
||||
parser.add_argument(
|
||||
"--override-filename",
|
||||
@ -84,7 +85,7 @@ def parse_args(args: list[str]) -> Options:
|
||||
"attribute",
|
||||
default=default_attribute,
|
||||
nargs="?" if default_attribute else None, # type: ignore
|
||||
help="Attribute name within the file evaluated",
|
||||
help='''Attribute name within the file evaluated (defaults to environment variable "UPDATE_NIX_ATTR_PATH")''',
|
||||
)
|
||||
|
||||
a = parser.parse_args(args)
|
||||
@ -309,7 +310,7 @@ def main(args: list[str] = sys.argv[1:]) -> None:
|
||||
|
||||
if options.review:
|
||||
if options.flake:
|
||||
print("--review is unsupporetd with --flake")
|
||||
print("--review is unsupported with --flake")
|
||||
else:
|
||||
nixpkgs_review()
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum, auto
|
||||
from enum import StrEnum, auto
|
||||
|
||||
|
||||
@dataclass
|
||||
@ -9,7 +9,7 @@ class Version:
|
||||
rev: str | None = None
|
||||
|
||||
|
||||
class VersionPreference(Enum):
|
||||
class VersionPreference(StrEnum):
|
||||
STABLE = auto()
|
||||
UNSTABLE = auto()
|
||||
FIXED = auto()
|
||||
|
Loading…
Reference in New Issue
Block a user