Skip to content

Commit 9373b0b

Browse files
committed
11180022
1 parent f857700 commit 9373b0b

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

Diff for: headers/thread_arg.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// You should have received a copy of the GNU General Public License
1616
// along with Clocker. If not, see <http://www.gnu.org/licenses/>.
1717

18-
#ifndef HEADERS_ENV_H
19-
#define HEADERS_ENV_H
18+
#ifndef _HEADERS_THREAD_ARG_H_
19+
#define _HEADERS_THREAD_ARG_H_
2020

2121
#include "../includes/common/inc.h"
2222
#include "mutexed.h"
@@ -58,11 +58,11 @@ INLINE Str time_mode_from(TimeMode mode) {
5858
return "busy";
5959

6060
case TM_Paused:
61-
return WRN_TXT("paused");
61+
return "paused";
6262

6363
default:
6464
return "";
6565
}
6666
}
6767

68-
#endif // HEADERS_ENV_H
68+
#endif // _HEADERS_THREAD_ARG_H_

Diff for: src/clocker.c

+13-7
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,21 @@ Int32 main(
6969
Str argv[]
7070
) {
7171

72-
Bool no_save = True;
73-
if (argv[1] && strcmp(argv[1], "--save") == 0) {
72+
Bool no_save = False;
73+
if (argv[1] && strcmp(argv[1], "--no-save") == 0) {
7474

75-
printf(WRN_TXT("\n WARNING: you are using UNSTABLE feature!\n"\
76-
" You may face some unknown behavior or crash in app.\n"\
77-
" This feature is just for testing no for normal usage.\n"
78-
" If you face any problem, contact me\n\n"));
75+
no_save = True;
76+
}
77+
78+
if (argv[1] && strcmp(argv[1], "--clean") == 0) {
7979

80-
no_save = False;
80+
printf(INF_TXT("\n Cleaning cash ..."));
81+
soft_assert_ret_int(
82+
remove("/root/.config/clocker/lock") == 0,
83+
"Removing lock file failed: (%s)!",
84+
strerror(errno)
85+
);
86+
printf(INF_TXT("\n Done!"));
8187
}
8288

8389
DataMaster master = data_master_on(no_save);

Diff for: src/components/cmd.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ Hndl cmd_run(Hndl arg) {
6868

6969
else if (strcmp(input, "pause\n") == 0 || (input[0] == 'P' && input[1] == '\n')) {
7070

71-
printf(WRN_TXT(" WARNING: You are using unstable feature\n"));
72-
7371
mutexed_change(command, gen_type(TC_Pause));
7472
mutexed_change(mode, gen_type(TM_Paused));
7573
}
@@ -103,13 +101,13 @@ Hndl cmd_run(Hndl arg) {
103101
else if (strcmp(input, "help\n") == 0 || (input[0] == 'h' && input[1] == '\n')) {
104102
printf("\n Clocker supports these commands:\n" \
105103
TRANSPARENT_TXT(BOLD_TXT(" b, busy "))\
106-
TRANSPARENT_TXT(ITALIC_TXT( ":I have no waste time, even when idel!\n"))\
104+
TRANSPARENT_TXT(ITALIC_TXT( ":I have no waste time, even when idle!\n"))\
107105
TRANSPARENT_TXT(BOLD_TXT(" d, default "))\
108-
TRANSPARENT_TXT(ITALIC_TXT(":Oh, I have some waste time, please cosider it!\n"))\
106+
TRANSPARENT_TXT(ITALIC_TXT(":Oh, I have some waste time, please consider it!\n"))\
109107
TRANSPARENT_TXT(BOLD_TXT(" r, report "))\
110108
TRANSPARENT_TXT(ITALIC_TXT(":Get me my time to here\n"))\
111109
TRANSPARENT_TXT(BOLD_TXT(" P, pause "))\
112-
TRANSPARENT_TXT(ITALIC_TXT(":Consider all times from now as waste ") WRN_TXT("(UNSTABLE)\n" ))\
110+
TRANSPARENT_TXT(ITALIC_TXT(":Consider all times from now as waste \n"))\
113111
TRANSPARENT_TXT(BOLD_TXT(" R, resume "))\
114112
TRANSPARENT_TXT(ITALIC_TXT(":Resume paused mode\n"))\
115113
TRANSPARENT_TXT(BOLD_TXT(" v, version "))\

0 commit comments

Comments
 (0)