
import sys
import subprocess

cmd = sys.argv[1]
new_args = sys.argv[2:] or []
subprocess.call(["pitz-%s" % cmd] + new_args)


import sys
import subprocess

def _help():
    subprocess.call(['pitz-help'])
    sys.exit(1)

if len(sys.argv) < 2:
    _help()

cmd = sys.argv[1]
new_args = sys.argv[2:] or []
try:
    subprocess.call(["pitz-%s" % cmd] + new_args)
except OSError as exc:
    _help()

Add at least a minimal exception handling (missing subcommand).
Add at least a minimal exception handling (missing subcommand).

  
  import sys
  import subprocess
  
+ def _help():
+     subprocess.call(['pitz-help'])
+     sys.exit(1)
+ 
+ if len(sys.argv) < 2:
+     _help()
+ 
  cmd = sys.argv[1]
  new_args = sys.argv[2:] or []
+ try:
- subprocess.call(["pitz-%s" % cmd] + new_args)
+     subprocess.call(["pitz-%s" % cmd] + new_args)
+ except OSError as exc:
+     _help()
  
Add at least a minimal exception handling (missing subcommand).
## Code Before:

import sys
import subprocess

cmd = sys.argv[1]
new_args = sys.argv[2:] or []
subprocess.call(["pitz-%s" % cmd] + new_args)

## Instruction:
Add at least a minimal exception handling (missing subcommand).
## Code After:

import sys
import subprocess

def _help():
    subprocess.call(['pitz-help'])
    sys.exit(1)

if len(sys.argv) < 2:
    _help()

cmd = sys.argv[1]
new_args = sys.argv[2:] or []
try:
    subprocess.call(["pitz-%s" % cmd] + new_args)
except OSError as exc:
    _help()
