Skip to content

Commit

Permalink
main: import what we need from argparse
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Mar 22, 2020
1 parent 086861d commit e61207c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions nixops/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@
# -*- coding: utf-8 -*-

from nixops import deployment
import argparse
from argparse import ArgumentParser, SUPPRESS, REMAINDER
import os
from nixops.script_defs import *

# Set up the parser.
parser = argparse.ArgumentParser(
description="NixOS cloud deployment tool", prog="nixops"
)
parser = ArgumentParser(description="NixOS cloud deployment tool", prog="nixops")
parser.add_argument("--version", action="version", version="NixOps @version@")

subparsers = parser.add_subparsers(
Expand All @@ -22,7 +20,7 @@
subparser = add_subparser(subparsers, "create", help="create a new deployment")
subparser.set_defaults(op=op_create)
subparser.add_argument(
"--name", "-n", dest="name", metavar="NAME", help=argparse.SUPPRESS
"--name", "-n", dest="name", metavar="NAME", help=SUPPRESS
) # obsolete, use -d instead
add_common_modify_options(subparser)

Expand Down Expand Up @@ -308,10 +306,7 @@
subparser.set_defaults(op=op_ssh)
subparser.add_argument("machine", metavar="MACHINE", help="identifier of the machine")
subparser.add_argument(
"args",
metavar="SSH_ARGS",
nargs=argparse.REMAINDER,
help="SSH flags and/or command",
"args", metavar="SSH_ARGS", nargs=REMAINDER, help="SSH flags and/or command",
)

subparser = add_subparser(
Expand Down

0 comments on commit e61207c

Please sign in to comment.