clan_cli: add select command
This commit is contained in:
17
pkgs/clan-cli/clan_cli/select.py
Normal file
17
pkgs/clan-cli/clan_cli/select.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import argparse
|
||||
import json
|
||||
|
||||
from clan_cli.flake import Flake
|
||||
|
||||
|
||||
def select_command(args: argparse.Namespace) -> None:
|
||||
flake = Flake(args.flake.path)
|
||||
print(json.dumps(flake.select(args.selector), indent=4))
|
||||
|
||||
|
||||
def register_parser(parser: argparse.ArgumentParser) -> None:
|
||||
parser.set_defaults(func=select_command)
|
||||
parser.add_argument(
|
||||
"selector",
|
||||
help="select from a flake",
|
||||
)
|
||||
Reference in New Issue
Block a user