opts: Add comments to opts:writeOptions(...)
@@ -1814,11 +1814,13 @@ void setOption (Key * option, const char * value, bool repeated)
int writeOptions (Key * command, Key * commandKey, Key * commandArgs, bool writeArgs, bool * argsWritten, KeySet * options,
struct Specification * spec, KeySet * ks, const char * progname, const char ** envp, Key * parentKey)
{
+ // Check if help message should be generated
Key * helpKey = keyNew (keyName (command), KEY_END);
keyAddName (helpKey, "/long/help");
+
+ // Generate help message
if (ksLookup (options, helpKey, KDB_O_DEL) != NULL)
{
- // show help
char * lastSlash = strrchr (progname, '/');
if (lastSlash != NULL)
{
@@ -1844,7 +1846,8 @@ int writeOptions (Key * command, Key * commandKey, Key * commandArgs, bool write
elektraFree (envsText);
return 1;
}
-
+ else // Don't generate help message
+ {
KeySet * envValues = parseEnvp (envp);
Key * argsParent = keyNew (keyName (command), KEY_END);
@@ -1925,6 +1928,7 @@ int writeOptions (Key * command, Key * commandKey, Key * commandArgs, bool write
return 0;
}
+}
KeySet * ksMetaGetSingleOrArray (Key * key, const char * metaName)
{
