try:
import apt_pkg
except ImportError:
- print "Error importing apt_pkg, is python-apt installed?"
+ print >> sys.stderr, "Error importing apt_pkg, is python-apt installed?"
sys.exit(1)
actions = { "markauto" : 1,
# option parsing
parser = OptionParser()
parser.usage = "%prog [options] {markauto|unmarkauto} packages..."
+ parser.epilog = "apt-mark is deprecated, use apt-get markauto/unmarkauto."
parser.add_option("-f", "--file", action="store", type="string",
dest="filename",
help="read/write a different file")
else:
STATE_FILE=options.filename
+ if len(args) == 0:
+ parser.error("first argument must be 'markauto', 'unmarkauto' or 'showauto'")
+
if args[0] == "showauto":
show_automatic(STATE_FILE)
else: