grisu / gricli

Grisu commandline client
7 stars 2 forks source link

Download job ~/example #226

Closed sina-masoud-ansari closed 12 years ago

sina-masoud-ansari commented 12 years ago

jobs> download job from_prod* ~/example_dir Downloading job from_prod to /home/smas036/~/example_dir/from_prod

Seems the ~ is is interpreted literally and appended to the current dir

Fully specified path is fine:

jobs> download job from_prod* /home/smas036/example_dir_2 Downloading job from_prod to /home/smas036/example_dir_2/from_prod

Relative path is fine to current dir is fine:

jobs> download job from_prod* example_dir_3 Downloading job from_prod to /home/smas036/example_dir_3/from_prod

Relative path is fine when required to make a subdir in an existing dir:

jobs> download job from_prod* example_dir_3/something Downloading job from_prod to /home/smas036/example_dir_3/something/from_prod

Relative path is fine when required to make multiple dirs

jobs> download job from_prod* example_dir_4/something Downloading job from_prod to /home/smas036/example_dir_4/something/from_prod

sina-masoud-ansari commented 12 years ago

Existing dir is an issue:

(_1) jobs> download job fromprod /home/smas036/example_dir_2 & Can't download job 'from_prod': target dir '/home/smas036/example_dir_2/from_prod' already exists. grisu.gricli.GricliRuntimeException: Can't download job 'from_prod': target dir '/home/smas036/example_dir_2/from_prod' already exists. at grisu.gricli.command.DownloadJobCommand.execute(DownloadJobCommand.java:131) at grisu.gricli.Gricli.runCommand(Gricli.java:418) at grisu.gricli.Gricli.executionLoop(Gricli.java:160) at grisu.gricli.Gricli.main(Gricli.java:370) (*1) jobs>

makkus commented 12 years ago

Will have a look at the '~' issue.

Not quite sure about the already exists thing. How should that be handled you think?

sina-masoud-ansari commented 12 years ago

How about a prompt for overwrite? (yes/no/all)

makkus commented 12 years ago

Hm, we don't have any prompts at the moment at all. Not sure whether we should introduce them. Although, I could imagine a few other situation where they would be useful ("Background tasks running, you sure you want to quit?"...)

sina-masoud-ansari commented 12 years ago

Yeah I think allowing for prompts could be useful in general, but would they cause problems in a script?

makkus commented 12 years ago

Good point, yes, I think it does.

I think we should leave it like it is atm and rely on the user to manage the target dir (i.e. delete an existing one if he really wants to overwrite). Everything else requires more effort and time and planning.

sina-masoud-ansari commented 12 years ago

Yup, I agree, an exception catch and a message like "Can't download job x to y because the directory already exists".

makkus commented 12 years ago

Isn't the exception catched already?

sina-masoud-ansari commented 12 years ago

Oh yeah, I had debug on :)