From 907f207d3b4535f98fd115439fd36c43b64f311f Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 29 May 2011 17:17:31 +0100 Subject: Use newer cliapp API for adding new settings. --- do-until | 12 ++++++------ fix-shebang | 3 +-- humanify | 9 ++++----- mksparse | 3 +-- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/do-until b/do-until index f71a233..c55f3d5 100755 --- a/do-until +++ b/do-until @@ -29,16 +29,16 @@ import time class DoUntil(cliapp.Application): def add_settings(self): - self.settings.add_boolean_setting(['no-act', 'n'], + self.settings.boolean(['no-act', 'n'], 'Do not run command, just pretend to do it, ' - 'and pretend that it succeeds.') - self.settings.add_boolean_setting(['verbose', 'v'], - 'Print command before executing it.') - self.settings.add_integer_setting(['sleep'], + 'and pretend that it succeeds.') + self.settings.boolean(['verbose', 'v'], + 'Print command before executing it.') + self.settings.integer(['sleep'], 'Wait SECS seconds before re-trying a command. ' '(Default is %default.)', default=1) - self.settings.add_integer_setting(['max-tries'], + self.settings.integer(['max-tries'], 'Try at most COUNT times, with 0 meaning forever. ' '(Default is %default.)', default=0) diff --git a/fix-shebang b/fix-shebang index ee1756d..8478cd2 100755 --- a/fix-shebang +++ b/fix-shebang @@ -23,8 +23,7 @@ import tempfile class FixShebang(cliapp.Application): def add_settings(self): - self.settings.add_string_setting(['shebang'], - 'interpreter path and args') + self.settings.string(['shebang'], 'interpreter path and args') def process_input(self, arg): name = self.create_tempfile_for(arg) diff --git a/humanify b/humanify index b7e69de..32454fc 100755 --- a/humanify +++ b/humanify @@ -45,11 +45,10 @@ class Humanify(cliapp.Application): ] def add_settings(self): - self.settings.add_boolean_setting(['binary', 'iec'], - 'use 10-based, not 2-based prefixes ' - '(ISO vs IEC)') - self.settings.add_boolean_setting(['bits'], - 'inputs give numbers of bits') + self.settings.boolean(['binary', 'iec'], + 'use 10-based, not 2-based prefixes ' + '(ISO vs IEC)') + self.settings.boolean(['bits'], 'inputs give numbers of bits') def process_args(self, args): self.units = self.determine_units() diff --git a/mksparse b/mksparse index 8d88399..bc5e28f 100755 --- a/mksparse +++ b/mksparse @@ -6,8 +6,7 @@ import cliapp class MakeSparseFile(cliapp.Application): def add_settings(self): - self.settings.add_bytesize_setting(['size'], - 'size of whole to append to file') + self.settings.bytesize(['size'], 'size of whole to append to file') def process_args(self, filenames): if self.settings['size'] > 0: -- cgit v1.2.1