summaryrefslogtreecommitdiff
path: root/cloudinit/cmd/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/cmd/main.py')
-rw-r--r--cloudinit/cmd/main.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/cloudinit/cmd/main.py b/cloudinit/cmd/main.py
index 5b467979..68563e0c 100644
--- a/cloudinit/cmd/main.py
+++ b/cloudinit/cmd/main.py
@@ -676,11 +676,10 @@ def main_features(name, args):
def main(sysv_args=None):
- if sysv_args is not None:
- parser = argparse.ArgumentParser(prog=sysv_args[0])
- sysv_args = sysv_args[1:]
- else:
- parser = argparse.ArgumentParser()
+ if not sysv_args:
+ sysv_args = sys.argv
+ parser = argparse.ArgumentParser(prog=sysv_args[0])
+ sysv_args = sysv_args[1:]
# Top level args
parser.add_argument('--version', '-v', action='version',