Ben Finney wrote:
> icarus writes:
>
>> parser = optparse.OptionParser(usage="%prog [-p dir] [--part=dir] ",
>> version="%prog 1.0")
>>
>> parser.add_option( "-p", "--part", dest="directory",
>>help="process target directory", metavar="dir")
>> (options, arg
icarus writes:
> parser = optparse.OptionParser(usage="%prog [-p dir] [--part=dir] ",
> version="%prog 1.0")
>
> parser.add_option( "-p", "--part", dest="directory",
> help="process target directory", metavar="dir")
> (options, args) = parser.parse_args(
On 2009-05-19 16:07, icarus wrote:
Why do I need to put two options for this script to print the path?
if I just specify the option and argument...
$ python
Why do I need to put two options for this script to print the path?
if I just specify the option and argument...
$ python
Rocky Zhou wrote:
> .dirs .files is just a snapshot of the current directories, which can
> be used to delete-outdated files when restoring. Here I used absolute
> path by using tar's -P parameter. When fs_rstore, it will do this:
> command = "tar -xpz -P -f %s.tgz -T %s" % (archive, self.t_files)
Well, I think I must have more explanation on my script. The script's
usage is like this:
~# fs_backup
Lack of backup identity name
program usage: fs_backup [OPTIONS] $identity
OPTIONS:
-a|--append [t/x[L]:$path, append 1 dir or file to $identity
t/x: include/exclude list, as -T/-X
Rocky Zhou wrote:
> I wonder is there any way to make the wrapper program can wrap options
> && arguments for the the subprocess/command the wrapper will
> execute? by getopt or optparse module?
[snip]
> I need this because I now have finished a fs_backup script written in
> python, it will execu
I wonder is there any way to make the wrapper program can wrap options
&& arguments for the the subprocess/command the wrapper will
execute? by getopt or optparse module?
This is something like the shell script like this:
optwrap=""
while [ $# -gt 0 ]; do
case $1 in
-a) do-something; s