summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2015-09-03 21:20:08 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2015-09-03 21:20:08 +0200
commitcfe29198821d407832320e2bc196f2a765968f77 (patch)
tree3072fd39d3b96e80a1b2124b3a86722019400938
parent6ae8831888dda42b639279aa6e6f05e80faafec2 (diff)
downloadcssh-cfe29198821d407832320e2bc196f2a765968f77.tar.gz
cssh-cfe29198821d407832320e2bc196f2a765968f77.tar.bz2
some thinking on naming and scp argument parsing
-rw-r--r--BUGS4
-rw-r--r--src/cssh.c18
2 files changed, 21 insertions, 1 deletions
diff --git a/BUGS b/BUGS
new file mode 100644
index 0000000..f26bf6a
--- /dev/null
+++ b/BUGS
@@ -0,0 +1,4 @@
+cssh name clash! this is severe and we must rename our project. GNU perl based
+pssh, also bad
+mssh is of course also taken, is interactive and not X based. Also quite nice, in Python
+
diff --git a/src/cssh.c b/src/cssh.c
index 3a85da0..95a7a5a 100644
--- a/src/cssh.c
+++ b/src/cssh.c
@@ -889,11 +889,27 @@ int main( int argc, char *argv[] )
} break;
case CSSH_EXECUTE_AS_SCP: {
+
+ if( args_info.inputs_num != 2 ) {
+ if( args_info.inputs_num < 2 ) {
+ fprintf( stderr, "ERROR: Expecting a source and a destination when copying, encountered less arguments\n" );
+ } else {
+ fprintf( stderr, "ERROR: Expecting a source and a destination when copying, encountered more arguments\n" );
+ }
+ cleanup_sessions( &session, NULL, NULL, NULL, NULL, NULL, host, port, nof_sessions, args_info.verbose_given > 0 );
+ exit( EXIT_FAILURE );
+ }
// TODO: parse 2 arguments and see where we have a local
// path and where a host destination with path
// TODO: host destination can be explicit (one without -H hosts
- // parameter) or it is a placeholder host @HOST@:/dira/dirb
+ // parameter) or it is a placeholder host user@host:/dira/dirb,
+ // so :/adir is a way or user@:/adir or host:/adir or user@host:adir
+ // also host: and user@host: for home dir on other side, this means
+ // we also have user@: for home on all hosts in -H hosts or
+ // just : for the home directory on all hosts in -H hosts.
+ // seems quite logical (at least to me :-))
+
copy_direction_e copy_direction = CSSH_COPY_DIRECTION_DOWNLOAD;
const char *local_directory = "adir";