Skip to content

Commit

Permalink
Merge pull request #4 from jfsmig/master
Browse files Browse the repository at this point in the history
client : rename the command in several help sections of CLI tools.
  • Loading branch information
jfsmig committed Mar 19, 2015
2 parents 67c3a32 + fb48bc0 commit 3c066d2
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 35 deletions.
45 changes: 23 additions & 22 deletions client/c/lib/hc_help.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ License along with this library.
void help_put(void)
{
g_printerr("\n");
g_printerr("usage: hc put <NS>/<CONTAINER_NAME>[/<CONTENT_NAME>] [<PATH_TO_FILE>]\n\n");
g_printerr("usage: %s put <NS>/<CONTAINER_NAME>[/<CONTENT_NAME>] [<PATH_TO_FILE>]\n\n", g_get_prgname());
g_printerr("\tCreates a new container or upload a new content in a container.\n\n");
g_printerr("\t NS : The namespace name\n");
g_printerr("\tCONTAINER_NAME : The container to create or to upload content in.\n");
Expand All @@ -39,7 +39,7 @@ void help_put(void)
void help_get(void)
{
g_printerr("\n");
g_printerr("usage: hc get <NS>/<CONTAINER_NAME>[/<CONTENT_NAME>][?version=<CONTENT_VERSION>] [<PATH_TO_FILE>]\n\n");
g_printerr("usage: %s get <NS>/<CONTAINER_NAME>[/<CONTENT_NAME>][?version=<CONTENT_VERSION>] [<PATH_TO_FILE>]\n\n", g_get_prgname());
g_printerr("\tList contents of a container or download a content from a container.\n\n");
g_printerr("\t NS : The namespace name\n");
g_printerr("\t CONTAINER_NAME : The container to list contents from or which contains the content to download.\n");
Expand All @@ -52,7 +52,7 @@ void help_get(void)
void help_delete(void)
{
g_printerr("\n");
g_printerr("usage: hc delete <NS>/<CONTAINER_NAME>[/<CONTENT_NAME>][?version=<CONTENT_VERSION>]\n\n");
g_printerr("usage: %s delete <NS>/<CONTAINER_NAME>[/<CONTENT_NAME>][?version=<CONTENT_VERSION>]\n\n", g_get_prgname());
g_printerr("\tDestroy a container or a content.\n\n");
g_printerr("\t NS : The namespace name\n");
g_printerr("\t CONTAINER_NAME : The container to destroy or which contains the content to delete.\n");
Expand All @@ -64,7 +64,7 @@ void help_delete(void)
void help_append(void)
{
g_printerr("\n");
g_printerr("usage: hc append <NS>/<CONTAINER_NAME>/<CONTENT_NAME> <PATH_TO_FILE>\n\n");
g_printerr("usage: %s append <NS>/<CONTAINER_NAME>/<CONTENT_NAME> <PATH_TO_FILE>\n\n", g_get_prgname());
g_printerr("\tAppend data to an existing content.\n\n");
g_printerr("\t NS : The namespace name\n");
g_printerr("\tCONTAINER_NAME : The container which contains the content.\n");
Expand All @@ -76,7 +76,7 @@ void help_append(void)
void help_info(void)
{
g_printerr("\n");
g_printerr("usage: hc info <NS>/<CONTAINER_NAME>[/<CONTENT_NAME>][?version=<CONTENT_VERSION>]\n\n");
g_printerr("usage: %s info <NS>/<CONTAINER_NAME>[/<CONTENT_NAME>][?version=<CONTENT_VERSION>]\n\n", g_get_prgname());
g_printerr("\tShow informations about a container or a content\n\n");
g_printerr("\t NS : The namespace name\n");
g_printerr("\t CONTAINER_NAME : The container to get informations from.\n");
Expand All @@ -87,7 +87,7 @@ void help_info(void)

void help_stgpol(void)
{
g_printerr("usage: hc stgpol <NS>/<CONTAINER_NAME>/<PATH> [STGPOL]\n\n");
g_printerr("usage: %s stgpol <NS>/<CONTAINER_NAME>/<PATH> [STGPOL]\n\n", g_get_prgname());
g_printerr(" NS: The namespace name\n");
g_printerr(" CONTAINER_NAME: The container you want to set the storage policy or which contain your content.\n");
g_printerr(" PATH: The targeted content path. If not specified, this command work on container storage policy\n");
Expand All @@ -96,14 +96,15 @@ void help_stgpol(void)

void help_quota(void)
{
g_printerr("usage: hc quota <NS>/<CONTAINER_NAME> QUOTA\n\n");
g_printerr("usage: %s quota <NS>/<CONTAINER_NAME> QUOTA\n\n", g_get_prgname());
g_printerr(" NS: The namespace name\n");
g_printerr(" CONTAINER_NAME: The container you want to set the storage policy or which contain your content.\n");
g_printerr(" QUOTA: The quota to set\n\n");
}

void help_version(void)
{
g_printerr("usage: hc version <NS>/<CONTAINER_NAME> VERSIONING\n\n");
g_printerr("usage: %s version <NS>/<CONTAINER_NAME> VERSIONING\n\n", g_get_prgname());
g_printerr(" NS: The namespace name\n");
g_printerr(" CONTAINER_NAME: The container you want to set the storage policy or which contain your content.\n");
g_printerr(" VERSIONING: The versioning to set. There is 4 "
Expand All @@ -118,38 +119,38 @@ void help_version(void)

void help_srvlist(void)
{
g_printerr("usage: hcdir srvlist <NS>/<CONTAINER_NAME> <SRV_TYPE>\n\n");
g_printerr("usage: %s srvlist <NS>/<CONTAINER_NAME> <SRV_TYPE>\n\n", g_get_prgname());
g_printerr(" NS: The namespace name\n");
g_printerr(" CONTAINER_NAME: The container you want to list services.\n");
g_printerr(" SRV_TYPE: The type of service you want to list (set ALL if you want to get all service types linked).\n");
}

void help_srvlink(void)
{
g_printerr("usage: hc srvlink <NS>/<CONTAINER> <SRV_TYPE>\n\n");
g_printerr("usage: %s srvlink <NS>/<CONTAINER> <SRV_TYPE>\n\n", g_get_prgname());
g_printerr(" NS: The namespace name\n");
g_printerr(" CONTAINER: The container you want to link service to.\n");
g_printerr(" SRV_TYPE: The type of service you want to link.\n");
}

void help_srvunlink(void)
{
g_printerr("usage: hc srvunlink <NS>/<CONTAINER> <SRV_TYPE>\n\n");
g_printerr("usage: %s srvunlink <NS>/<CONTAINER> <SRV_TYPE>\n\n", g_get_prgname());
g_printerr(" NS: The namespace name\n");
g_printerr(" CONTAINER: The container you want to unlink service from.\n");
g_printerr(" SRV_TYPE: The type of service you want to unlink.\n");
g_printerr(" (This functionally will be improved later.)\n");
}

void help_srvpoll(void) {
g_printerr("usage: hc srvpoll <NS>/<CONTAINER> <TYPE>\n\n");
g_printerr("usage: %s srvpoll <NS>/<CONTAINER> <TYPE>\n\n", g_get_prgname());
g_printerr(" NS: The namespace name\n");
g_printerr(" CONTAINER: The container you want to manage services.\n");
g_printerr(" TYPE: A type of service managed in the given namespace.\n");
}

void help_srvforce(void) {
g_printerr("usage: hc srvforce <NS>/<CONTAINER> '<SEQ>|<TYPE>|<URL>|<ARGS>'\n\n");
g_printerr("usage: %s srvforce <NS>/<CONTAINER> '<SEQ>|<TYPE>|<URL>|<ARGS>'\n\n", g_get_prgname());
g_printerr(" NS: The namespace name\n");
g_printerr(" CONTAINER: The container you want to work with.\n");
g_printerr(" SEQ: The sequence number for the given (service,container) association\n");
Expand All @@ -159,7 +160,7 @@ void help_srvforce(void) {
}

void help_srvconfig(void) {
g_printerr("usage: hc srvconfig <NS>/<REF> '<SEQ>|<TYPE>|<URL>|<ARGS>'\n\n");
g_printerr("usage: %s srvconfig <NS>/<REF> '<SEQ>|<TYPE>|<URL>|<ARGS>'\n\n", g_get_prgname());
g_printerr(" NS: The namespace name\n");
g_printerr(" REF: The container you want to work with.\n");
g_printerr(" SEQ: The sequence number for the given (service,container) association\n");
Expand All @@ -169,7 +170,7 @@ void help_srvconfig(void) {
}

void help_propset(void) {
g_printerr("usage: hc propset <NS>/<CONTAINER>/<CONTENT> <KEY> <VALUE>\n\n");
g_printerr("usage: %s propset <NS>/<CONTAINER>/<CONTENT> <KEY> <VALUE>\n\n", g_get_prgname());
g_printerr(" NS: The namespace name\n");
g_printerr(" CONTAINER: The container you want to work with.\n");
g_printerr(" CONTENT: The content you want to work with.\n");
Expand All @@ -178,14 +179,14 @@ void help_propset(void) {
}

void help_propget(void) {
g_printerr("usage: hc propget <NS>/<CONTAINER>/<CONTENT>\n\n");
g_printerr("usage: %s propget <NS>/<CONTAINER>/<CONTENT>\n\n", g_get_prgname());
g_printerr(" NS: The namespace name\n");
g_printerr(" CONTAINER: The container you want to work with.\n");
g_printerr(" CONTENT: The content you want to work with.\n");
}

void help_propdel(void) {
g_printerr("usage: hc propdel <NS>/<CONTAINER>/<CONTENT> <KEY> ....\n\n");
g_printerr("usage: %s propdel <NS>/<CONTAINER>/<CONTENT> <KEY> ....\n\n", g_get_prgname());
g_printerr(" NS: The namespace name\n");
g_printerr(" CONTAINER: The container you want to work with.\n");
g_printerr(" CONTENT: The content you want to work with.\n");
Expand All @@ -195,7 +196,7 @@ void help_propdel(void) {
void help_snaplist(void)
{
g_printerr("\n");
g_printerr("usage: hc snaplist <NS>/<CONTAINER_NAME>\n\n");
g_printerr("usage: %s snaplist <NS>/<CONTAINER_NAME>\n\n", g_get_prgname());
g_printerr("\tList snapshots of a container\n\n");
g_printerr("\t NS: The namespace name\n");
g_printerr("\t CONTAINER_NAME: The container to list snapshots from\n");
Expand All @@ -205,7 +206,7 @@ void help_snaplist(void)
void help_snaptake(void)
{
g_printerr("\n");
g_printerr("usage: hc snaptake <NS>/<CONTAINER_NAME>?snapshot=<SNAPSHOT_NAME>\n\n");
g_printerr("usage: %s snaptake <NS>/<CONTAINER_NAME>?snapshot=<SNAPSHOT_NAME>\n\n", g_get_prgname());
g_printerr("\tTake a snapshot of a container\n\n");
g_printerr("\t NS: The namespace name\n");
g_printerr("\t CONTAINER_NAME: The container to take a snapshot of\n");
Expand All @@ -215,7 +216,7 @@ void help_snaptake(void)
void help_snapdel(void)
{
g_printerr("\n");
g_printerr("usage: hc snapdel <NS>/<CONTAINER_NAME>?snapshot=<SNAPSHOT_NAME>\n\n");
g_printerr("usage: %s snapdel <NS>/<CONTAINER_NAME>?snapshot=<SNAPSHOT_NAME>\n\n", g_get_prgname());
g_printerr("\tDelete a snapshot\n\n");
g_printerr("\t NS: The namespace name\n");
g_printerr("\t CONTAINER_NAME: The container to delete snapshot from\n");
Expand All @@ -225,8 +226,8 @@ void help_snapdel(void)
void help_snaprestore(void)
{
g_printerr("\n");
g_printerr("usage: hc snaprestore <NS>/<CONTAINER_NAME>?snapshot=<SNAPSHOT_NAME>\n");
g_printerr("or hc snaprestore <NS>/<CONTAINER_NAME>/<CONTENT_NAME>?snapshot=<SNAPSHOT_NAME>\n\n");
g_printerr("usage: %s snaprestore <NS>/<CONTAINER_NAME>?snapshot=<SNAPSHOT_NAME>\n", g_get_prgname());
g_printerr("or %s snaprestore <NS>/<CONTAINER_NAME>/<CONTENT_NAME>?snapshot=<SNAPSHOT_NAME>\n\n", g_get_prgname());
g_printerr("\tRestore a snapshot or a content from a snapshot\n\n");
g_printerr("\t NS: The namespace name\n");
g_printerr("\t CONTAINER_NAME: The container to restore snapshot of\n");
Expand Down
7 changes: 3 additions & 4 deletions client/c/tools/hc.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ __display_friendly_error(gs_error_t *error) {

/* debug info */
if(!error || !error->msg) {
g_printerr("Action 'hc %s' failed, but no error specified.", action);
g_printerr("Action '%s %s' failed, but no error specified.", g_get_prgname(), action);
return;
}

Expand Down Expand Up @@ -1009,7 +1009,7 @@ static const gchar *
hc_usage(void)
{
return "<command> [<args>]\n\n"
"The available hc commands are:\n"
"The available commands are:\n"
"\tput\t\tCreate a container or upload a content\n"
"\tget\t\tList a container or download a content\n"
"\tdelete\t\tDestroy a container or delete a content\n"
Expand All @@ -1035,8 +1035,7 @@ hc_usage(void)
"\tsnapdel\t\tDelete a snapshot\n"
"\tsnaprestore\tRestore a snapshot or a content from a snapshot\n"
"\tsnaplist\tList snapshots of a container\n"
"\n"
"See 'hc help <command>' for more information on a specific command.\n\n";
"\n";
}

static gboolean
Expand Down
14 changes: 7 additions & 7 deletions client/c/tools/hcadmin.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static void
_display_err(gchar *msg, gs_error_t *err)
{
if(!err->msg) {
g_printerr("Action 'hcadmin %s' failed, but no error specified.\n", action);
g_printerr("Action '%s %s' failed, but no error specified.\n", g_get_prgname(), action);
return;
}

Expand All @@ -73,7 +73,7 @@ static void
help_meta1_policy_update()
{
g_printerr("\n");
g_printerr("usage: hcadmin meta1_policy_apply NS ALL|PREFIX|REFERENCE_ID [SRVTYPE]\n\n");
g_printerr("usage: %s meta1_policy_apply NS ALL|PREFIX|REFERENCE_ID [SRVTYPE]\n\n", g_get_prgname());
g_printerr("\t NS : The namespace name\n");
g_printerr("\t ALL : apply the meta1 policy to all references defined in the namespace\n");
g_printerr("\t PREFIX : apply the meta1 policy only to the references defined for this prefix. (Prefix is defined by 4 hexadecimal digits)\n");
Expand All @@ -86,7 +86,7 @@ static void
help_meta1_policy_exclude()
{
g_printerr("\n");
g_printerr("usage: hcadmin meta1_policy_exclude NS ALL|PREFIX|REFERENCE_ID SRV_URL\n\n");
g_printerr("usage: %s meta1_policy_exclude NS ALL|PREFIX|REFERENCE_ID SRV_URL\n\n", g_get_prgname());
g_printerr("\tThis action can be use to exclude a meta2 service and replace it by another service for the replication mechanism\n\n");
g_printerr("\t NS : The namespace name\n");
g_printerr("\t ALL : apply the meta1 policy to all references defined in the namespace\n");
Expand All @@ -100,8 +100,8 @@ static void
help_touch(void)
{
g_printerr("\n");
g_printerr("usage: hcadmin touch <NS>/<CONTAINER_NAME> [UPDATE_CSIZE|RECALC_CSIZE]\n");
g_printerr("or hcadmin touch <NS>/<CONTAINER_NAME>/<CONTENT_NAME>\n\n");
g_printerr("usage: %s touch <NS>/<CONTAINER_NAME> [UPDATE_CSIZE|RECALC_CSIZE]\n", g_get_prgname());
g_printerr("or %s touch <NS>/<CONTAINER_NAME>/<CONTENT_NAME>\n\n", g_get_prgname());
g_printerr("\tExecute a touch command on a container or on a simgle content\n\n");
g_printerr("\t NS : The namespace name\n");
g_printerr("\t CONTAINER_NAME : The container to restore snapshot of\n");
Expand Down Expand Up @@ -253,12 +253,12 @@ static const gchar *
hcadmin_usage(void)
{
return "<command> NS[/Container/Content] [<args>]\n\n"
"The available hcadmin commands are:\n"
"The available commands are:\n"
"\tmeta1_policy_apply\tapply the meta1 policy of replication\n"
"\tmeta1_policy_exclude\texclude service on mechanism of meta1 replication\n"
"\ttouch \texecute a touch command on a container or a content on a meta2\n"
"\n"
"See 'hcadmin help <command>' for more information on a specific command.\n\n";
"See 'help <command>' for more information on a specific command.\n\n";
}

static gboolean
Expand Down
4 changes: 2 additions & 2 deletions client/c/tools/hcdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ static const gchar *
hcdir_usage(void)
{
return "<command> [<args>]\n"
"\nThe available hcdir commands are:\n"
"\nThe available commands are:\n"
" create Create a reference in a namespace\n"
" has Ensure a reference exists in a namespace\n"
" delete Delete a reference from a namespace\n"
Expand All @@ -679,7 +679,7 @@ hcdir_usage(void)
" propset Associates a property to a reference\n"
" propdel Dissociates (deletes) a property for a given reference\n"
"\n"
"See 'hcdir help <command>' for more information on a specific"
"See 'help <command>' for more information on a specific"
"command. (Not yet implemented)\n";
}

Expand Down

0 comments on commit 3c066d2

Please # to comment.