Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Kdb cli rewrite #4807

Closed
wants to merge 22 commits into from
Closed

Kdb cli rewrite #4807

wants to merge 22 commits into from

Conversation

hannes99
Copy link
Contributor

@hannes99 hannes99 commented Jan 4, 2023

Issue: #4431

Basics

  • Short descriptions of your changes are in the release notes
    (added as entry in doc/news/_preparation_next_release.md which
    contains _(my name)_)
    Please always add something to the release notes.
  • Details of what you changed are in commit messages
    (first line should have module: short statement syntax)
  • References to issues, e.g. close #X, are in the commit messages.
  • The buildservers are happy. If not, fix in this order:
    • add a line in doc/news/_preparation_next_release.md
    • reformat the code with scripts/dev/reformat-all
    • make all unit tests pass
    • fix all memleaks
  • The PR is rebased with current master.

Checklist

  • I added unit tests for my code
  • I fully described what my PR does in the documentation
    (not in the PR description)
  • I fixed all affected documentation (see Documentation Guidelines)
  • I fixed all affected decisions (see Decision Process)
  • I added code comments, logging, and assertions as appropriate (see Coding Guidelines)
  • I updated all meta data (e.g. README.md of plugins and METADATA.ini)
  • I mentioned every code not directly written by me in reuse syntax

Review

Labels

  • Add the "work in progress" label if you do not want the PR to be reviewed yet.
  • Add the "ready to merge" label if the basics are fulfilled and no further pushes are planned by you.

and add command.h containing helpful macros and a struct def that is
needed later
... to command.c for resolving bookmarks in keynames.
... and remove cpp implementation
... and remove cpp implementation
... and remove cpp implementation
... and remove cpp implementation
... and remove cpp implementation
.. and remove cpp implementation
... and a GET_BASIC_OPTIONS macro for reading all basic basic options
at the start of a command
... and (partial) fix #3742, fix #4028, fix #1164
}
char * tmp = elektraMalloc (elektraStrLen (escapeCode) + elektraStrLen (text) + elektraStrLen (RESET) + 1);
strcpy (tmp, escapeCode);
strcat (tmp, text);

Check failure

Code scanning / CodeQL

Potentially unsafe use of strcat

Always check the size of the source buffer when using strcat.

printKsNames (currentMountConfig);

printf ("MOUNT");

Check failure

Code scanning / CodeQL

Missing return statement

Function execMount should return a value of type int but does not return a value here

int execRemount (KeySet * options, Key * errorKey)
{
printf ("RE-MOUNT");

Check failure

Code scanning / CodeQL

Missing return statement

Function execRemount should return a value of type int but does not return a value here

int execUmount (KeySet * options, Key * errorKey)
{
printf ("UN-MOUNT");

Check failure

Code scanning / CodeQL

Missing return statement

Function execUmount should return a value of type int but does not return a value here
return mountSubcommands[i].exec (options, errorKey);
}
}
}

Check failure

Code scanning / CodeQL

Missing return statement

Function execMountpoint should return a value of type int but does not return a value here
return result;
}

int execCmerge (KeySet * options, Key * errorKey)

Check warning

Code scanning / CodeQL

Poorly documented large function

Poorly documented function: fewer than 2% comments for a function of 157 lines.

int execMount (KeySet * options, Key * errorKey)
{
int ret = 0;

Check notice

Code scanning / CodeQL

Unused local variable

Variable ret is not used.
elektraKeyToBoolean (GET_OPTION_KEY (options, "verbose"), &verbose);
}

const char * path = GET_OPTION (options, "path");

Check notice

Code scanning / CodeQL

Unused local variable

Variable path is not used.

void printOptions (elektraLookupFlags options)
{
// :'<,'>s/\(.*\)/^Iif(options \& \1) printf("\1 ");

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.

KeySet * currentMountConfig = getMountConfig (handle, errorKey);

Key * mountpointKey = keyNew (mountpoint, KEY_END);

Check notice

Code scanning / CodeQL

Unused local variable

Variable mountpointKey is not used.
ADD_BASIC_OPTIONS (spec, COMMAND_SPEC_KEY (COMMAND_NAME))
}

int execMv (KeySet * options, Key * errorKey)

Check warning

Code scanning / CodeQL

Poorly documented large function

Poorly documented function: fewer than 2% comments for a function of 106 lines.
ADD_BASIC_OPTIONS (spec, COMMAND_SPEC_KEY (COMMAND_NAME))
}

int execCp (KeySet * options, Key * errorKey)

Check warning

Code scanning / CodeQL

Poorly documented large function

Poorly documented function: fewer than 2% comments for a function of 113 lines.
@hannes99 hannes99 force-pushed the kdb_cli_rewrite branch 5 times, most recently from d1590d9 to af46517 Compare March 6, 2023 16:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant