Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
KDesp73 committed Aug 16, 2024
1 parent 241e8c5 commit df97f41
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),

### Changed

- Using -y to skip warning message
- Included import command to help messages
- Updated version to 0.0.7

### Fixed
Expand Down
1 change: 1 addition & 0 deletions include/help.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ void get_help();
void edit_help();
void push_help();
void generate_help();
void import_help();

#endif // HELP_H
8 changes: 5 additions & 3 deletions src/commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,10 +812,12 @@ void command_import(Options options)
char* delete_releases = "DELETE FROM Releases";
char* delete_entries = "DELETE FROM Entries";

WARN("This will replace all entries and releases");
int y = yes_or_no("Continue?");
if(!options.yes){
WARN("This will replace all entries and releases");
int y = yes_or_no("Continue?");

if(!y) return;
if(!y) return;
}

sqlite_execute_sql(SQLITE_DB, delete_entries);
sqlite_execute_sql(SQLITE_DB, delete_releases);
Expand Down
11 changes: 11 additions & 0 deletions src/help.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ void help()
PTNI("push <options> Push an unpushed release to Github");
PTNI("export [<options>] Exports the CHANGELOG.md file");
PTNI("generate <value> Generate various files");
PTNI("import <options> Import CHANGELOG.md file into the database");

PTN("");

Expand Down Expand Up @@ -165,3 +166,13 @@ void generate_help()
PTNI("autocomplete Autocomplete for the active shell");
PTNI("man Man page for %s", EXECUTABLE_NAME);
}

void import_help()
{
PTN("%sUSAGE%s", BOLD, RESET);
PTNI("%s import <options>", EXECUTABLE_NAME);
PTN("");
PTN("%sOPTIONS%s", BOLD, RESET);
PTNI("-h --help Prints this message");
PTNI("-f --file <path> File to import");
}
3 changes: 3 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ void help_message(Command command)
case COMMAND_GENERATE:
generate_help();
break;
case COMMAND_IMPORT:
import_help();
break;
case COMMAND_UNSET:
case COMMAND_UNKNOWN:
case COMMAND_INIT:
Expand Down

0 comments on commit df97f41

Please sign in to comment.