Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
T
time-slime
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Michael Rouse
time-slime
Commits
461411cd
Commit
461411cd
authored
Aug 19, 2018
by
Michael Rouse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Help screen. And don't initialize Time Slime if just going to the help screen
parent
75ecef53
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
23 deletions
+17
-23
shell/shell.c
shell/shell.c
+16
-22
shell/string_literals.h
shell/string_literals.h
+1
-1
No files found.
shell/shell.c
View file @
461411cd
...
...
@@ -18,23 +18,25 @@ int main(int argc, char *argv[])
{
log_dull
(
"==== Time Slime ====
\n
"
)
char
*
base_folder
=
args_get_directory_of_executable
(
argv
[
0
]);
status
=
TimeSlime_Initialize
(
base_folder
);
if
(
status
!=
TIMESLIME_OK
)
{
printf
(
"An error occured: %d
\n
"
,
status
);
return
-
1
;
}
// Parse command line arguments
args_t
parsed_args
;
parsed_args
=
args_parse
(
argc
,
argv
);
if
(
parsed_args
.
help
)
{
//
display_help();
display_help
();
}
else
{
// Initialize the TimeSlime library with path for database file
char
*
base_folder
=
args_get_directory_of_executable
(
argv
[
0
]);
status
=
TimeSlime_Initialize
(
base_folder
);
if
(
status
!=
TIMESLIME_OK
)
{
printf
(
"An error occured: %d
\n
"
,
status
);
return
-
1
;
}
if
(
strcmp
(
parsed_args
.
action
,
ADD_ACTION
)
==
0
)
perform_add_action
(
parsed_args
);
...
...
@@ -48,12 +50,13 @@ int main(int argc, char *argv[])
{
printf
(
"Error: %d
\n
"
,
status
);
}
TimeSlime_Close
();
free
(
base_folder
);
base_folder
=
NULL
;
}
TimeSlime_Close
();
free
(
base_folder
);
base_folder
=
NULL
;
return
0
;
}
...
...
@@ -171,7 +174,7 @@ void perform_report_action(timeslime_args args)
}
/* Help Screen *
/* Help Screen *
/
void
display_help
(
void
)
{
printf
(
"Author: %s
\n
"
,
AUTHOR
);
...
...
@@ -202,12 +205,3 @@ void display_help(void)
printf
(
"
\n
"
);
}
static int callback(void *NotUsed, int argc, char **argv, char **azColName) {
int i;
for(i = 0; i<argc; i++) {
printf("%s = %s\n", azColName[i], argv[i] ? argv[i] : "NULL");
}
printf("\n");
return 0;
}
*/
\ No newline at end of file
shell/string_literals.h
View file @
461411cd
...
...
@@ -31,7 +31,7 @@
#define PROGRAM_NAME "timeslime"
#define AUTHOR "Michael Rouse"
#define DESCRIPTION "\nTime Slime is a command line utility to keep \ntrack of hours worked remotely. \nA time sheet in your terminal!"
#define PROGRAM_VERSION "2018.08.1
4
"
#define PROGRAM_VERSION "2018.08.1
9
"
#define DATABASE_FILE "timeslime.db"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment