Merge lp:~knitzsche/apport/catch-invalid-arg-combo into lp:~apport-hackers/apport/trunk

Proposed by Kyle Nitzsche
Status: Merged
Merged at revision: 2539
Proposed branch: lp:~knitzsche/apport/catch-invalid-arg-combo
Merge into: lp:~apport-hackers/apport/trunk
Diff against target: 16 lines (+6/-0)
1 file modified
bin/apport-retrace (+6/-0)
To merge this branch: bzr merge lp:~knitzsche/apport/catch-invalid-arg-combo
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+136838@code.launchpad.net

Description of the change

On apport-retrace, using -C argument without -S argument does not make sense, since the cache is only used when creating a sandbox.

This catches this arg combination, warns user, and exits.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Thanks! This seems rather strong, but it might avoid confusion.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/apport-retrace'
2--- bin/apport-retrace 2012-10-19 03:53:58 +0000
3+++ bin/apport-retrace 2012-11-29 03:39:20 +0000
4@@ -79,6 +79,12 @@
5 optparser.error(_('incorrect number of arguments; use --help for a short help'))
6 sys.exit(1)
7
8+# catch invalid useage of -C without -S (cache is only used when making a
9+# sandbox)
10+ if opts.cache and not opts.sandbox:
11+ optparser.error( _('You cannot use -C without -S. Stopping.'))
12+ sys.exit(1)
13+
14 if not (opts.auth or opts.output or opts.stdout or opts.gdb):
15 optparser.error(_('you either need to do a local operation (-s, -g, -o) or supply an authentication file (--auth); see --help for a short help'))
16 sys.exit(1)

Subscribers

People subscribed via source and target branches