View | Details | Raw Unified | Return to bug 46407
Collapse All | Expand All

(-)tasksh-1.0.0/AUTHORS (-1 / +11 lines)
Lines 3-12 Link Here
3
3
4
  Paul Beckingham    (Principal Author)
4
  Paul Beckingham    (Principal Author)
5
  Federico Hernandez (Principal Author)
5
  Federico Hernandez (Principal Author)
6
  Dirk Deimeke       (Technical Advisor & Evangelist)
6
7
7
The following submitted code, packages or analysis, and deserve special thanks:
8
The following submitted code, packages or analysis, and deserve special thanks:
8
9
9
  None - it's too new
10
  Jörg Krause
11
  Ben Boeckel
12
  ilove zfs
13
  Paul Fenwick
10
14
11
Thanks to the following, who submitted detailed bug reports and excellent
15
Thanks to the following, who submitted detailed bug reports and excellent
12
suggestions:
16
suggestions:
Lines 15-18 Link Here
15
  Fidel Mato
19
  Fidel Mato
16
  David Stahl
20
  David Stahl
17
  David Patrick
21
  David Patrick
22
  jonbobbly
23
  hosaka
24
  Lars Kumbier
25
  Iain R. Learmonth
26
  Eric Hymowitz
27
  bjonnh
18
28
(-)tasksh-1.0.0/ChangeLog (-7 / +44 lines)
Lines 1-13 Link Here
1
1.2.0 (2017-05-10) -
2
3
- TS-29   tasksh hangs trying to read task from stdin
4
          (thanks to ilove zfs).
5
- TS-32   control-d to exit
6
          (thanks to Eric Hymowitz, Paul Fenwick).
7
- TS-34   Tasksh throw a warning at the end of a review command
8
          (thanks to bjonnh).
9
- Review report now defaults to 6 days instead of 1 weeķ, which is more
10
  convenient for those who review weekly
11
          (thanks to Dirk Deimeke).
12
13
------ current release ---------------------------
14
15
1.1.0 (2016-09-06) 464f5ae19f853911e739c2489897aef64345c388
16
17
- TD-120  Missing cmakedefine for HAVE_GET_CURRENT_DIR_NAME
18
          (Thanks to Jörg Krause, Ben Boeckel).
19
- TW-1845 Cygwin build fails, missing get_current_dir_name
20
          (thanks to hosaka).
21
- TS-11   Autoclear in the Task Shell
22
          (thanks to Lars Kumbier).
23
- TS-24   add review option (m)odify
24
          (thanks to David Patrick).
25
- TS-28   Please add a (m)odify feature for review
26
          (thanks to Iain R. Learmonth).
27
- Implemented 'review' command.
28
- Implemented 'diag' command.
29
- Added 'review N' option, to specify the number of tasks you would like to
30
  review.
31
- Integrated libshared.git.
32
33
------ old releases ------------------------------
34
1
1.0.0 (2014-12-21) 5934dfcefac6d037a359bc733a8382e42e32552e
35
1.0.0 (2014-12-21) 5934dfcefac6d037a359bc733a8382e42e32552e
2
36
3
- TS-1 Apostrophe inside tasksh 'log' causes segmentation fault (thanks to
37
- TS-1    Apostrophe inside tasksh 'log' causes segmentation fault
4
       David Stahl).
38
          (thanks to David Stahl).
5
- TS-2 tasksh segfaults if quotes not closed (thanks to Fidel Mato).
39
- TS-2    tasksh segfaults if quotes not closed
6
- TS-5 tasksh segfaults (thanks to David Patrick).
40
          (thanks to Fidel Mato).
7
- TS-13 Quotes included when using task shell (thanks to Kevin Gunn).
41
- TS-5    tasksh segfaults
42
          (thanks to David Patrick).
43
- TS-13   Quotes included when using task shell
44
          (thanks to Kevin Gunn).
8
- libreadline support added for line editing and command history.
45
- libreadline support added for line editing and command history.
9
46
10
Project started 2014-06-08
11
12
------ start -----------------------------------
47
------ start -----------------------------------
13
48
49
Project started 2014-06-08
50
(-)tasksh-1.0.0/cmake.h.in (+11 lines)
Lines 47-49 Link Here
47
/* Found wordexp.h */
47
/* Found wordexp.h */
48
#cmakedefine HAVE_WORDEXP
48
#cmakedefine HAVE_WORDEXP
49
49
50
/* Found tm.tm_gmtoff struct member */
51
#cmakedefine HAVE_TM_GMTOFF
52
53
/* Found st.st_birthtime struct member */
54
#cmakedefine HAVE_ST_BIRTHTIME
55
56
/* Functions */
57
#cmakedefine HAVE_GET_CURRENT_DIR_NAME
58
#cmakedefine HAVE_TIMEGM
59
#cmakedefine HAVE_UUID_UNPARSE_LOWER
60
(-)tasksh-1.0.0/CMakeLists.txt (-58 / +18 lines)
Lines 1-48 Link Here
1
cmake_minimum_required (VERSION 2.8)
1
cmake_minimum_required (VERSION 2.8)
2
set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
2
set (CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
3
3
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
4
include (CheckFunctionExists)
5
include (CheckStructHasMember)
6
7
set (HAVE_CMAKE true)
4
set (HAVE_CMAKE true)
8
5
9
project (tasksh)
6
project (tasksh)
10
set (PROJECT_VERSION "1.0.0")
7
include (CXXSniffer)
11
8
12
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
9
set (PROJECT_VERSION "1.2.0")
13
  set (LINUX true)
14
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
15
  set (DARWIN true)
16
elseif (${CMAKE_SYSTEM_NAME} MATCHES "kFreeBSD")
17
  set (KFREEBSD true)
18
elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
19
  set (FREEBSD true)
20
elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
21
  set (OPENBSD true)
22
elseif (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
23
  set (NETBSD true)
24
elseif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
25
  set (SOLARIS true)
26
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "GNU")
27
  set (GNUHURD true)
28
else (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
29
  set (UNKNOWN true)
30
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
31
32
if (NETBSD)
33
   # Since readline, etc likely to be in /usr/pkg/lib, not standard library
34
   # Otherwise will remove links during install
35
   set (CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
36
endif (NETBSD)
37
10
38
if (FREEBSD)
11
include (CheckFunctionExists)
39
SET (TASKSH_MAN1DIR man/man1            CACHE STRING "Installation directory for man pages, section 1")
12
include (CheckStructHasMember)
40
else (FREEBSD)
13
include (CheckCXXCompilerFlag)
41
SET (TASKSH_MAN1DIR share/man/man1      CACHE STRING "Installation directory for man pages, section 1")
42
endif (FREEBSD)
43
SET (TASKSH_DOCDIR  share/doc/tasksh    CACHE STRING "Installation directory for doc files")
44
SET (TASKSH_RCDIR "${TASKSH_DOCDIR}/rc" CACHE STRING "Installation directory for configuration files")
45
SET (TASKSH_BINDIR  bin                 CACHE STRING "Installation directory for the binary")
46
14
47
message ("-- Looking for SHA1 references")
15
message ("-- Looking for SHA1 references")
48
if (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
16
if (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
Lines 63-75 Link Here
63
set (PACKAGE_VERSION "${VERSION}")
31
set (PACKAGE_VERSION "${VERSION}")
64
set (PACKAGE_STRING "${PACKAGE} ${VERSION}")
32
set (PACKAGE_STRING "${PACKAGE} ${VERSION}")
65
33
66
message ("-- Looking for pthread")
34
if (FREEBSD)
67
find_package (Threads)
35
SET (TASKSH_MAN1DIR man/man1            CACHE STRING "Installation directory for man pages, section 1")
68
if (THREADS_FOUND)
36
else (FREEBSD)
69
  set (HAVE_LIBPTHREAD true)
37
SET (TASKSH_MAN1DIR share/man/man1      CACHE STRING "Installation directory for man pages, section 1")
70
  set (TASKD_INCLUDE_DIRS ${TASKD_INCLUDE_DIRS} ${THREADS_INCLUDE_DIR})
38
endif (FREEBSD)
71
  set (TASKD_LIBRARIES    ${TASKD_LIBRARIES}    ${THREADS_LIBRARIES})
39
SET (TASKSH_DOCDIR  share/doc/tasksh    CACHE STRING "Installation directory for doc files")
72
endif (THREADS_FOUND)
40
SET (TASKSH_RCDIR "${TASKSH_DOCDIR}/rc" CACHE STRING "Installation directory for configuration files")
41
SET (TASKSH_BINDIR  bin                 CACHE STRING "Installation directory for the binary")
73
42
74
# include the readline library finder module
43
# include the readline library finder module
75
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
44
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules")
Lines 83-97 Link Here
83
  set (TASKSH_LIBRARIES    ${TASKSH_LIBRARIES}    ${READLINE_LIBRARIES})
52
  set (TASKSH_LIBRARIES    ${TASKSH_LIBRARIES}    ${READLINE_LIBRARIES})
84
endif (READLINE_FOUND)
53
endif (READLINE_FOUND)
85
54
86
# Set the package language.
87
if (LANGUAGE)
88
  set (PACKAGE_LANGUAGE ${LANGUAGE})
89
else (LANGUAGE)
90
  set (PACKAGE_LANGUAGE 1)
91
endif (LANGUAGE)
92
93
set (LANGUAGE_ENG_USA 1)
94
95
message ("-- Configuring cmake.h")
55
message ("-- Configuring cmake.h")
96
configure_file (
56
configure_file (
97
  ${CMAKE_SOURCE_DIR}/cmake.h.in
57
  ${CMAKE_SOURCE_DIR}/cmake.h.in
Lines 103-109 Link Here
103
  add_subdirectory (test EXCLUDE_FROM_ALL)
63
  add_subdirectory (test EXCLUDE_FROM_ALL)
104
endif (EXISTS ${CMAKE_SOURCE_DIR}/test)
64
endif (EXISTS ${CMAKE_SOURCE_DIR}/test)
105
65
106
set (doc_FILES NEWS ChangeLog README.md INSTALL AUTHORS COPYING)
66
set (doc_FILES NEWS ChangeLog INSTALL AUTHORS COPYING)
107
foreach (doc_FILE ${doc_FILES})
67
foreach (doc_FILE ${doc_FILES})
108
  install (FILES ${doc_FILE}  DESTINATION ${TASKSH_DOCDIR})
68
  install (FILES ${doc_FILE}  DESTINATION ${TASKSH_DOCDIR})
109
endforeach (doc_FILE)
69
endforeach (doc_FILE)
Lines 114-119 Link Here
114
set (CPACK_SOURCE_PACKAGE_FILE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION})
74
set (CPACK_SOURCE_PACKAGE_FILE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION})
115
set (CPACK_SOURCE_IGNORE_FILES  "CMakeCache" "CMakeFiles" "CPackConfig" "CPackSourceConfig"
75
set (CPACK_SOURCE_IGNORE_FILES  "CMakeCache" "CMakeFiles" "CPackConfig" "CPackSourceConfig"
116
                                "_CPack_Packages" "cmake_install" "install_manifest" "Makefile$"
76
                                "_CPack_Packages" "cmake_install" "install_manifest" "Makefile$"
117
                                "test" "package-config" "misc/*" "src/tasksh$"
77
                                "test" "package-config" "misc/*" "src/tasksh$" "README.md"
118
                                "/\\.gitignore" "/\\.git/" "swp$")
78
                                "/\\\\.gitignore" "/\\\\.git/" "swp$")
119
include (CPack)
79
include (CPack)
(-)tasksh-1.0.0/COPYING (-1 / +1 lines)
Lines 1-6 Link Here
1
tasksh - a shell/frontend for the command line task list manager taskwarrior.
1
tasksh - a shell/frontend for the command line task list manager taskwarrior.
2
2
3
Copyright 2006 - 2014, Paul Beckingham, Federico Hernandez.
3
Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
4
4
5
Permission is hereby granted, free of charge, to any person obtaining a copy
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
of this software and associated documentation files (the "Software"), to deal
6
of this software and associated documentation files (the "Software"), to deal
(-)tasksh-1.0.0/doc/man/tasksh.1.in (-14 / +62 lines)
Lines 1-22 Link Here
1
.TH tasksh 1 2014-12-21 "${PACKAGE_STRING}" "User Manuals"
1
.TH tasksh 1 2017-05-10 "${PACKAGE_STRING}" "User Manuals"
2
2
3
.SH NAME
3
.SH NAME
4
tasksh \- Interactive taskwarrior shell
4
tasksh \- Interactive taskwarrior shell
5
5
6
.SH SYNOPSIS
6
.SH SYNOPSIS
7
.B tasksh [<commands-file>]
7
.B tasksh
8
.br
8
.br
9
.B tasksh --version
9
.B tasksh --version
10
.br
11
.B tasksh --help
12
10
13
.SH DESCRIPTION
11
.SH DESCRIPTION
14
The tasksh program can be used to create a more immersive taskwarrior
12
Tasksh can be used to create a more immersive taskwarrior environment.
15
environment.  Any task command you run outside the shell can also be run inside
13
Any task command you run outside the shell can also be run inside
16
the shell, without the need to prefix every command with "task".
14
the shell, without the need to prefix every command with "task".
17
15
18
When built with libreadline, tasksh provides command editing and history.
16
When built with libreadline, tasksh provides command editing and history.
19
17
18
Tasksh has an integrated 'review' command that leads you through an interactive
19
review session.
20
20
Tasksh supports all recent versions of Taskwarrior.
21
Tasksh supports all recent versions of Taskwarrior.
21
22
22
.SH COMMANDS
23
.SH COMMANDS
Lines 24-35 Link Here
24
Taskwarrior.
25
Taskwarrior.
25
26
26
.TP
27
.TP
27
.B exit/quit/Ctrl-D
28
.B diagnostics
28
These commands cause tasksh to terminate.
29
Displays settings pertinent to tasksh, for diagnosing problems.
29
30
30
.TP
31
.TP
31
.B diagnostics
32
.B exec <commands>
32
Displays settings pertinent to tasksh.
33
This command allows you to run shell commands from within Tasksh. This is ideal
34
for accessing man pages such as this. The '!' command can be used in place of
35
the 'exec' keyword. Once the command is run, control returns to Tasksh.
36
37
.TP
38
.B exit/quit
39
These commands cause tasksh to terminate, returning you to your system shell.
40
41
.TP
42
.B help
43
Shows a summary of commands, and how to obtain help.
44
45
.TP
46
.B review [N]
47
Begins an interactive review session, where you can mark tasks as reviewed,
48
edit them using your text editor, provide modification commands, or skip them.
49
You can terminate a review session at any time, and the next review session
50
will resume at the right place.
51
52
To find tasks needing review, the '_reviewed' custom report is created and run,
53
which filters tasks that have a missing 'reviewed' UDA date, or have not been
54
reviewed for a week.
55
56
This means that if you run a review session to completion, there will be no
57
need to review again for a week, and the review command will simply do nothing
58
until then.
59
60
The one week review cycle is defined by the '_reviewed' custom report, which
61
can be modified if you prefer a monthly review cycle.
62
63
If 'N' is provided, the session is limited to reviewing only N tasks.
64
65
Note: requires Taskwarrior 2.5.0 or later.
66
For full details, see: 
67
<https://taskwarrior.org/docs/review.html>
33
68
34
.SH USAGE
69
.SH USAGE
35
Here is an example tasksh session.
70
Here is an example tasksh session.
Lines 74-84 Link Here
74
.br
109
.br
75
---------------------------------------------------------------------
110
---------------------------------------------------------------------
76
.br
111
.br
77
 2 party   H   10/17/2010        2 hrs Select and book a venue
112
 2 party   H   10/17/2015        2 hrs Select and book a venue
78
.br
113
.br
79
 5 party   H   10/22/2010        2 hrs Design invitations
114
 5 party   H   10/22/2015        2 hrs Design invitations
80
.br
115
.br
81
 9 home        10/31/2010         1 hr Pay rent
116
 9 home        10/31/2015         1 hr Pay rent
82
.br
117
.br
83
 3 party                         2 hrs Mail invitations
118
 3 party                         2 hrs Mail invitations
84
.br
119
.br
Lines 95-102 Link Here
95
 $
130
 $
96
.br
131
.br
97
132
133
.SH CONFIGURATION
134
Tasksh piggybacks on Taskwarrior's .taskrc configuration file, and refers
135
to settings there. If you use a non-standard location for your .task database
136
, and .taskrc file, Tasksh will not find them unless you set the TASKDATA and
137
TASKRC environment variables. See 'man taskrc' for more details.
138
139
The review command storeѕ a UDA ('reviewed') and report definition ('_reviewed').
140
141
.TP
142
.B tasksh.autoclear=1
143
If set to "1", causes each tasksh command to be preceded by a 'clear screen' and
144
cursor reset. Default is "0".
145
98
.SH "CREDITS & COPYRIGHTS"
146
.SH "CREDITS & COPYRIGHTS"
99
Copyright (C) 2006 \- 2014 P. Beckingham, F. Hernandez.
147
Copyright (C) 2006 \- 2017 P. Beckingham, F. Hernandez.
100
148
101
This man page was originally written by Federico Hernandez.
149
This man page was originally written by Federico Hernandez.
102
150
(-)tasksh-1.0.0/INSTALL (-8 / +102 lines)
Lines 1-37 Link Here
1
Installation Instructions
1
Installation Instructions
2
-------------------------
2
-------------------------
3
3
4
Please follow the instructions below to build tasksh with cmake.
4
Please follow the instructions below to build and install tasksh from source.
5
5
6
6
7
Pre-requisites
7
Dependencies
8
--------------
8
------------
9
10
You will need the CMake build system installed in order to build tasksh from
11
source.  Information on cmake can be obtained at http://cmake.org
9
12
10
You will need the CMake build system installed in order to build tasksh
13
Additionally, you will need:
11
from source.
12
14
13
More information on cmake can be obtained at http://cmake.org
15
  libreadline
14
16
15
17
16
Basic Installation
18
Basic Installation
17
------------------
19
------------------
18
20
21
Briefly, these shell commands will unpack, build and install Tasksh:
22
23
  $ tar xzf tasksh-X.Y.Z.tar.gz                   [1]
24
  $ cd tasksh-X.Y.Z                               [2]
25
  $ cmake -DCMAKE_BUILD_TYPE=release .            [3]
26
  $ make                                          [4]
27
  $ sudo make install                             [5]
28
  $ cd .. ; rm -r tasksh-X.Y.Z                    [6]
29
30
These commands are explained below:
31
32
  1. Unpacks the source tarball.  This creates the directory tasksh-X.Y.Z,
33
     containing all the code.
34
35
  2. Change directory to the root of the distribution.
36
37
  3. Invokes CMake to scan for dependencies and machine-specific details, then
38
     generate the makefiles.  Requests an optimized build, which will run faster
39
     and be more compact.  This may take a minute.
40
41
  4. Builds tasksh.  This may take a minute.
42
43
  5. Installs the program, documentation and other data files.
44
45
  6. Removes the temporary directory.
46
47
19
Build and configurations options
48
Build and configurations options
20
--------------------------------
49
--------------------------------
21
50
22
Localizations
51
You can customize the configuration run with cmake variables. This will modify
23
-------------
52
the installation process:
53
54
To change the installation directory you use the following configuration
55
variable:
56
57
  $ cmake -DCMAKE_INSTALL_PREFIX=<path-to-installation-dir> .
58
59
cmake configuration variables are applied with the -D option and consist of a
60
<name> and a <value>:
61
62
  $ cmake -D<name>=<value> .
63
64
Four more variables can customize the installation process. The following table
65
lists them and their defaults plus the CMAKE_INSTALL_PREFIX:
66
67
  CMAKE_INSTALL_PREFIX  /usr/local
68
  TASKSH_BINDIR         bin
69
  TASKSH_DOCDIR         share/doc/tasksh
70
  TASKSH_MAN1DIR        share/man/man1
71
72
The corresponding TASKSH_* variables will be combined with CMAKE_INSTALL_PREFIX to
73
get absolute installation directories:
74
75
  CMAKE_INSTALL_PREFIX/TASKSH_BINDIR   /usr/local/bin
76
  CMAKE_INSTALL_PREFIX/TASKSH_DOCDIR   /usr/local/share/doc/tasksh
77
  CMAKE_INSTALL_PREFIX/TASKSH_MAN1DIR  /usr/local/share/man/man1
78
24
79
25
Uninstallation
80
Uninstallation
26
--------------
81
--------------
27
82
83
There is no uninstall option in CMake makefiles. This is a manual process.
84
85
To uninstall Tasksh, remove the files listed in the install_manifest.txt file
86
that was generated when you built Tasksh.
87
88
28
Tasksh Build Notes
89
Tasksh Build Notes
29
-----------------------
90
-----------------------
30
91
92
Tasksh has dependencies that are detected by CMake in almost all cases, but
93
there are situations and operating systems that mean you will need to offer a
94
little help.
95
96
If Tasksh will not build on your system, first take a look at the Operating
97
System notes below.  If this doesn't help, then go to the Troubleshooting
98
section, which includes instructions on how to contact us for help.
99
100
31
Operating System Notes
101
Operating System Notes
32
----------------------
102
----------------------
33
103
104
Cygwin
105
  If 'make install' fails when writing to the /usr/local/share/ directory,
106
  this may be because your current login doesn't have permission to write
107
  to the Windows directory containing your Cygwin installation. Either
108
  login to Windows as an Administrator and try the 'make install' process
109
  again, or reinstall Cygwin under your normal Windows login.
110
111
34
Troubleshooting
112
Troubleshooting
35
---------------
113
---------------
36
114
115
If you've recently made changes to dependencies (by reinstalling them, for
116
example) be sure to rerun 'cmake .' before trying to execute 'make' again.
117
118
CMake will run and locate all the necessary pieces for the build, and create
119
a Makefile.  There may be errors and warnings when running CMake, or there
120
may be compiler errors and warnings when running 'make'.  Sometimes you will run
121
CMake with no reported problems, and the build will fail later.  This is
122
almost always because CMake is mistaken about some assumption.
123
124
If a build does not succeed, please send the contents of the 'CMakeCache.txt'
125
and 'CMakeFiles/CMakeOutput.log' files to support@taskwarrior.org.
126
127
If CMake runs but tasksh does not build, please send the contents of the above
128
files as well as a transcript from the build, which is not written to a file
129
and must be captured from the terminal.
130
37
---
131
---
(-)tasksh-1.0.0/LICENSE (-1 / +1 lines)
Lines 1-6 Link Here
1
tasksh - a shell/frontend for ithe command line task list manager taskwarrior.
1
tasksh - a shell/frontend for ithe command line task list manager taskwarrior.
2
2
3
Copyright 2006 - 2014, Paul Beckingham, Federico Hernandez.
3
Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
4
4
5
Permission is hereby granted, free of charge, to any person obtaining a copy
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
of this software and associated documentation files (the "Software"), to deal
6
of this software and associated documentation files (the "Software"), to deal
(-)tasksh-1.0.0/NEWS (-19 / +9 lines)
Lines 1-37 Link Here
1
1
2
New Features in tasksh 1.0
2
New Features in tasksh 1.2.0
3
3
4
  - libreadline support.  Actually, the only feature.
4
  - Responds to Ctrl-D by exiting.
5
5
6
New commands in tasksh 1.0
6
New commands in tasksh 1.2.0
7
7
8
  - 'exit', 'quit' or Ctrl-D exits the shell
8
  - 
9
  - 'diagnostics' shows $PATH and where it found Taskwarrior
10
  - 'help' references the man page
11
9
12
New configuration options in tasksh 1.0
10
New configuration options in tasksh 1.2.0
13
11
14
  - None
12
  - 
15
16
Newly deprecated features in tasksh 1.0
17
18
  - None
19
20
Removed features in 1.0
21
22
  - None
23
13
24
Known Issues
14
Known Issues
25
15
26
  - None
16
  - 
27
17
28
Tasksh has been built and tested on the following configurations:
18
Tasksh has been built and tested on the following configurations:
29
19
30
  * OS X
20
  * macOS
31
  * Fedora
21
  * Fedora
32
  * Ubuntu
22
  * Ubuntu
33
  * Debian
23
  * Debian
34
  * Arch Linux
24
  * Arch
35
  * FreeBSD
25
  * FreeBSD
36
  * Cygwin
26
  * Cygwin
37
27
(-)tasksh-1.0.0/src/CMakeLists.txt (-7 / +20 lines)
Lines 1-19 Link Here
1
cmake_minimum_required (VERSION 2.8)
1
cmake_minimum_required (VERSION 2.8)
2
include_directories (${CMAKE_SOURCE_DIR}
2
include_directories (${CMAKE_SOURCE_DIR}
3
                     ${CMAKE_SOURCE_DIR}/src
3
                     ${CMAKE_SOURCE_DIR}/src
4
                     ${CMAKE_SOURCE_DIR}/src/libshared/src
4
                     ${TASKSH_INCLUDE_DIRS})
5
                     ${TASKSH_INCLUDE_DIRS})
5
6
6
set (tasksh_SRCS diag.cpp
7
set (tasksh_SRCS diag.cpp
7
                 help.cpp
8
                 help.cpp
8
                 prompt.cpp
9
                 prompt.cpp
9
                 Color.cpp Color.h
10
                 review.cpp
10
                 Path.cpp Path.h
11
                 shell.cpp)
11
                 File.cpp File.h
12
                 Directory.cpp Directory.h
13
                 text.cpp  text.h)
14
12
15
add_executable (tasksh_executable main.cpp ${tasksh_SRCS})
13
set (libshared_SRCS libshared/src/Color.cpp         libshared/src/Color.h
16
target_link_libraries (tasksh_executable ${TASKSH_LIBRARIES})
14
                    libshared/src/Datetime.cpp      libshared/src/Datetime.h
15
                    libshared/src/Duration.cpp      libshared/src/Duration.h
16
                    libshared/src/FS.cpp            libshared/src/FS.h
17
                    libshared/src/Lexer.cpp         libshared/src/Lexer.h
18
                    libshared/src/Pig.cpp           libshared/src/Pig.h
19
                    libshared/src/shared.cpp        libshared/src/shared.h
20
                    libshared/src/format.cpp        libshared/src/format.h
21
                    libshared/src/unicode.cpp       libshared/src/unicode.h
22
                    libshared/src/utf8.cpp          libshared/src/utf8.h
23
                    libshared/src/wcwidth6.cpp)
24
25
add_library (tasksh    STATIC ${tasksh_SRCS})
26
add_library (libshared STATIC ${libshared_SRCS})
27
add_executable (tasksh_executable main.cpp)
28
29
target_link_libraries (tasksh_executable tasksh libshared ${TASKSH_LIBRARIES})
17
30
18
set_property (TARGET tasksh_executable PROPERTY OUTPUT_NAME "tasksh")
31
set_property (TARGET tasksh_executable PROPERTY OUTPUT_NAME "tasksh")
19
32
(-)tasksh-1.0.0/src/diag.cpp (-16 / +109 lines)
Lines 1-6 Link Here
1
////////////////////////////////////////////////////////////////////////////////
1
////////////////////////////////////////////////////////////////////////////////
2
//
2
//
3
// Copyright 2006 - 2014, Paul Beckingham, Federico Hernandez.
3
// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
4
//
4
//
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
6
// of this software and associated documentation files (the "Software"), to deal
6
// of this software and associated documentation files (the "Software"), to deal
Lines 25-38 Link Here
25
////////////////////////////////////////////////////////////////////////////////
25
////////////////////////////////////////////////////////////////////////////////
26
26
27
#include <cmake.h>
27
#include <cmake.h>
28
#include <commit.h>
28
#include <iostream>
29
#include <iostream>
29
#include <string>
30
#include <string>
30
#include <vector>
31
#include <vector>
31
#include <cstring>
32
#include <cstring>
32
#include <stdlib.h>
33
#include <stdlib.h>
33
#include <File.h>
34
#include <FS.h>
34
#include <i18n.h>
35
#include <Color.h>
35
#include <text.h>
36
#include <shared.h>
37
#include <format.h>
36
38
37
#ifdef HAVE_READLINE
39
#ifdef HAVE_READLINE
38
#include <readline/readline.h>
40
#include <readline/readline.h>
Lines 42-69 Link Here
42
////////////////////////////////////////////////////////////////////////////////
44
////////////////////////////////////////////////////////////////////////////////
43
int cmdDiagnostics ()
45
int cmdDiagnostics ()
44
{
46
{
45
  // TODO Version
47
  Color bold ("bold");
46
  // TODO Platform
48
47
  // TODO pthreads
49
  std::cout << "\n"
48
  // TODO libreadline
50
            << bold.colorize (PACKAGE_STRING)
51
            << "\n"
52
            << "   " << "Platform: " << osName ()
53
            << "\n\n";
54
55
  // Compiler.
56
  std::cout << bold.colorize ("Compiler")
57
            << "\n"
58
#ifdef __VERSION__
59
            << "    " << "Version: "
60
            << __VERSION__ << "\n"
61
#endif
62
            << "       " << "Caps:"
63
#ifdef __STDC__
64
            << " +stdc"
65
#endif
66
#ifdef __STDC_HOSTED__
67
            << " +stdc_hosted"
68
#endif
69
#ifdef __STDC_VERSION__
70
            << " +" << __STDC_VERSION__
71
#endif
72
#ifdef _POSIX_VERSION
73
            << " +" << _POSIX_VERSION
74
#endif
75
#ifdef _POSIX2_C_VERSION
76
            << " +" << _POSIX2_C_VERSION
77
#endif
78
#ifdef _ILP32
79
            << " +ILP32"
80
#endif
81
#ifdef _LP64
82
            << " +LP64"
83
#endif
84
            << " +c"      << 8 * sizeof (char)
85
            << " +i"      << 8 * sizeof (int)
86
            << " +l"      << 8 * sizeof (long)
87
            << " +vp"     << 8 * sizeof (void*)
88
            << " +time_t" << 8 * sizeof (time_t)
89
            << "\n";
90
91
  // Compiler compliance level.
92
  std::cout << " Compliance: "
93
            << cppCompliance ()
94
            << "\n\n";
95
96
  std::cout << bold.colorize ("Build Features")
97
            << "\n"
98
99
  // Build date.
100
            << "      " << "Built: " << __DATE__ << " " << __TIME__ << "\n"
101
#ifdef HAVE_COMMIT
102
            << "     " << "Commit: " << COMMIT << "\n"
103
#endif
104
            << "      CMake: " << CMAKE_VERSION << "\n";
105
106
  std::cout << "libreadline: "
107
#ifdef HAVE_READLINE
108
#ifdef RL_VERSION_MAJOR
109
            << RL_VERSION_MAJOR << "." << RL_VERSION_MINOR
110
#elif defined RL_READLINE_VERSION
111
            << "0x" << std::hex << RL_READLINE_VERSION
112
#endif
113
#else
114
            << "n/a"
115
#endif
116
            << "\n";
117
118
  std::cout << " Build type: "
119
#ifdef CMAKE_BUILD_TYPE
120
            << CMAKE_BUILD_TYPE
121
#else
122
            << "-"
123
#endif
124
            << "\n\n";
125
126
  std::cout << bold.colorize ("Configuration")
127
            << "\n";
128
129
  auto env = getenv ("TASKRC");
130
  std::cout << "     TASKRC: "
131
            << (env ? env : "")
132
            << "\n";
133
134
  env = getenv ("TASKDATA");
135
  std::cout << "   TASKDATA: "
136
            << (env ? env : "")
137
            << "\n";
49
138
50
  // Taskwarrior version + location
139
  // Taskwarrior version + location
51
  std::string path (getenv ("PATH"));
140
  std::string path (getenv ("PATH"));
52
  std::cout << "PATH " << path << "\n";
141
  std::cout << "       PATH: " << path << "\n";
53
54
  std::vector <std::string> paths;
55
  split (paths, path, ':');
56
142
57
  std::vector <std::string>::iterator i;
143
  for (const auto& i : split (path, ':'))
58
  for (i = paths.begin (); i != paths.end (); ++i)
59
  {
144
  {
60
    File task (*i + "/task");
145
    File task (i + "/task");
61
    if (task.exists ())
146
    if (task.exists ())
62
    {
147
    {
63
      std::cout << "Taskwarrior " << (*i + "/task") << "\n";
148
      std::string input;
149
      std::string output;
150
      execute ("task", {"--version"}, input, output);
151
152
      std::cout << "Taskwarrior: "
153
                << i
154
                << "/task "
155
                << output; // Still has \n
64
    }
156
    }
65
  }
157
  }
66
158
159
  std::cout << "\n";
67
  return 0;
160
  return 0;
68
}
161
}
69
162
(-)tasksh-1.0.0/src/help.cpp (-5 / +13 lines)
Lines 1-6 Link Here
1
////////////////////////////////////////////////////////////////////////////////
1
////////////////////////////////////////////////////////////////////////////////
2
//
2
//
3
// Copyright 2006 - 2014, Paul Beckingham, Federico Hernandez.
3
// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
4
//
4
//
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
6
// of this software and associated documentation files (the "Software"), to deal
6
// of this software and associated documentation files (the "Software"), to deal
Lines 26-39 Link Here
26
26
27
#include <cmake.h>
27
#include <cmake.h>
28
#include <iostream>
28
#include <iostream>
29
#include <cstring>
30
#include <i18n.h>
31
#include <text.h>
32
29
33
////////////////////////////////////////////////////////////////////////////////
30
////////////////////////////////////////////////////////////////////////////////
34
int cmdHelp ()
31
int cmdHelp ()
35
{
32
{
36
  std::cout << "Run 'man tasksh' for help.\n";
33
  std::cout << '\n'
34
            << "  Commands:\n"
35
            << "    tasksh> list             Or any other Taskwarrior command\n"
36
            << "    tasksh> review [N]       Task review session, with optional cutoff after N tasks\n"
37
            << "    tasksh> exec ls -al      Any shell command.  May also use '!ls -al'\n"
38
            << "    tasksh> help             Tasksh help\n"
39
            << "    tasksh> diagnostics      Tasksh diagnostics\n"
40
            << "    tasksh> quit             End of session. May also use 'exit'\n"
41
            << '\n'
42
            << "Run 'man tasksh' from your shell prompt.\n"
43
            << "Run '! man tasksh' from inside tasksh.\n"
44
            << '\n';
37
  return 0;
45
  return 0;
38
}
46
}
39
47
(-)tasksh-1.0.0/src/main.cpp (-29 / +82 lines)
Lines 1-6 Link Here
1
////////////////////////////////////////////////////////////////////////////////
1
////////////////////////////////////////////////////////////////////////////////
2
//
2
//
3
// Copyright 2006 - 2014, Paul Beckingham, Federico Hernandez.
3
// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
4
//
4
//
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
6
// of this software and associated documentation files (the "Software"), to deal
6
// of this software and associated documentation files (the "Software"), to deal
Lines 26-36 Link Here
26
26
27
#include <cmake.h>
27
#include <cmake.h>
28
#include <iostream>
28
#include <iostream>
29
#include <vector>
29
#include <string>
30
#include <string>
30
#include <cstring>
31
#include <cstring>
32
#include <cstdio>
31
#include <stdlib.h>
33
#include <stdlib.h>
32
#include <i18n.h>
34
#include <unistd.h>
33
#include <text.h>
35
#include <shared.h>
34
36
35
#ifdef HAVE_READLINE
37
#ifdef HAVE_READLINE
36
#include <readline/readline.h>
38
#include <readline/readline.h>
Lines 44-59 Link Here
44
// tasksh commands.
46
// tasksh commands.
45
int cmdHelp ();
47
int cmdHelp ();
46
int cmdDiagnostics ();
48
int cmdDiagnostics ();
47
std::string composePrompt ();
49
int cmdReview (const std::vector <std::string>&, bool);
50
int cmdShell (const std::vector <std::string>&);
51
std::string promptCompose ();
48
std::string findTaskwarrior ();
52
std::string findTaskwarrior ();
49
53
50
////////////////////////////////////////////////////////////////////////////////
54
////////////////////////////////////////////////////////////////////////////////
51
static int commandLoop ()
55
static void welcome ()
52
{
56
{
53
  // TODO Local data: timer, context stack.  No globals.
57
  std::cout << PACKAGE_STRING << "\n";
58
  cmdHelp ();
59
}
54
60
55
  // Compose the prompt.
61
////////////////////////////////////////////////////////////////////////////////
56
  std::string prompt = composePrompt ();
62
const std::string getResponse (const std::string& prompt)
63
{
64
  std::string response {""};
57
65
58
  // Display prompt, get input.
66
  // Display prompt, get input.
59
#ifdef HAVE_READLINE
67
#ifdef HAVE_READLINE
Lines 61-100 Link Here
61
  if (! line_read)
69
  if (! line_read)
62
  {
70
  {
63
    std::cout << "\n";
71
    std::cout << "\n";
64
    return -1;
72
    response = "<EOF>";
65
  }
73
  }
74
  else
75
  {
76
    // Save history.
77
    if (*line_read)
78
      add_history (line_read);
66
79
67
  // Save history.
80
    response = std::string (line_read);
68
  if (*line_read)
81
    free (line_read);
69
    add_history (line_read);
82
  }
70
71
  std::string command (line_read);
72
  free (line_read);
73
#else
83
#else
74
  std::cout << prompt;
84
  std::cout << prompt;
75
  std::string command;
85
  std::getline (std::cin, response);
76
  std::getline (std::cin, command);
77
  if (std::cin.eof () == 1)
86
  if (std::cin.eof () == 1)
78
  {
87
  {
79
    std::cout << "\n";
88
    std::cout << "\n";
80
    return -1;
89
    response = "<EOF>";
81
  }
90
  }
82
#endif
91
#endif
83
92
84
  // Dispatch command
93
  return response;
94
}
95
96
////////////////////////////////////////////////////////////////////////////////
97
static int commandLoop (bool autoClear)
98
{
99
  // Compose the prompt.
100
  auto prompt = promptCompose ();
101
102
  // Display prompt, get input.
103
  auto command = getResponse (prompt);
104
105
  // Obey Taskwarrior's rc.tasksh.autoclear.
106
  if (autoClear)
107
    std::cout << "\033[2J\033[0;0H";
108
85
  int status = 0;
109
  int status = 0;
86
       if (closeEnough ("exit",        command, 3)) status = -1;
110
  if (! isatty (fileno (stdin)) && command == "")
87
  else if (closeEnough ("quit",        command, 3)) status = -1;
111
  {
88
  else if (closeEnough ("help",        command, 3)) status = cmdHelp ();
112
    status = -1;
89
  else if (closeEnough ("diagnostics", command, 3)) status = cmdDiagnostics ();
113
  }
90
  else if (command != "")
114
  else if (command != "")
91
  {
115
  {
92
    std::cout << "[task " << command << "]\n";
116
    auto args = split (command, ' ');
93
    command = "task " + command;
117
94
    system (command.c_str ());
118
    // Dispatch command.
119
         if (args[0] == "<EOF>")                      status = -1;
120
    else if (closeEnough ("exit",        args[0], 3)) status = -1;
121
    else if (closeEnough ("quit",        args[0], 3)) status = -1;
122
    else if (closeEnough ("help",        args[0], 3)) status = cmdHelp ();
123
    else if (closeEnough ("diagnostics", args[0], 3)) status = cmdDiagnostics ();
124
    else if (closeEnough ("review",      args[0], 3)) status = cmdReview (args, autoClear);
125
    else if (closeEnough ("exec",        args[0], 3) ||
126
             args[0][0] == '!')                       status = cmdShell (args);
127
    else if (command != "")
128
    {
129
      command = "task " + command;
130
      std::cout << "[" << command << "]\n";
131
      system (command.c_str ());
95
132
96
    // Deliberately ignoreѕ taskwarrior exit status, otherwise empty filters
133
      // Deliberately ignoreѕ taskwarrior exit status, otherwise empty filters
97
    // cause the shell to terminate.
134
      // cause the shell to terminate.
135
    }
98
  }
136
  }
99
137
100
  return status;
138
  return status;
Lines 114-120 Link Here
114
  {
152
  {
115
    try
153
    try
116
    {
154
    {
117
      while ((status = commandLoop ()) == 0)
155
      // Get the Taskwarrior rc.tasksh.autoclear Boolean setting.
156
      bool autoClear = false;
157
      std::string input;
158
      std::string output;
159
      execute ("task", {"_get", "rc.tasksh.autoclear"}, input, output);
160
      output = lowerCase (output);
161
      autoClear = (output == "true\n" ||
162
                   output == "1\n"    ||
163
                   output == "y\n"    ||
164
                   output == "yes\n"  ||
165
                   output == "on\n");
166
167
      if (isatty (fileno (stdin)))
168
        welcome ();
169
170
      while ((status = commandLoop (autoClear)) == 0)
118
        ;
171
        ;
119
    }
172
    }
120
173
(-)tasksh-1.0.0/src/prompt.cpp (-3 / +65 lines)
Lines 1-6 Link Here
1
////////////////////////////////////////////////////////////////////////////////
1
////////////////////////////////////////////////////////////////////////////////
2
//
2
//
3
// Copyright 2006 - 2014, Paul Beckingham, Federico Hernandez.
3
// Copyright 2006 - 2017, Paul Beckingham, Federico Hernandez.
4
//
4
//
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
5
// Permission is hereby granted, free of charge, to any person obtaining a copy
6
// of this software and associated documentation files (the "Software"), to deal
6
// of this software and associated documentation files (the "Software"), to deal
Lines 25-41 Link Here
25
////////////////////////////////////////////////////////////////////////////////
25
////////////////////////////////////////////////////////////////////////////////
26
26
27
#include <cmake.h>
27
#include <cmake.h>
28
#include <vector>
28
#include <string>
29
#include <string>
30
#include <Color.h>
31
32
static std::vector <std::string> contextColors = {
33
  "bold white on red",
34
  "bold white on blue",
35
  "bold white on green",
36
  "bold white on magenta",
37
  "black on cyan",
38
  "black on yellow",
39
  "black on white",
40
};
41
42
static std::vector <std::string> contexts;
43
44
std::string composeContexts (bool pretty = false);
45
46
////////////////////////////////////////////////////////////////////////////////
47
int promptClear ()
48
{
49
  contexts.clear ();
50
  return 0;
51
}
52
53
////////////////////////////////////////////////////////////////////////////////
54
int promptRemove ()
55
{
56
  if (contexts.size ())
57
    contexts.pop_back ();
58
59
  return 0;
60
}
29
61
30
////////////////////////////////////////////////////////////////////////////////
62
////////////////////////////////////////////////////////////////////////////////
31
std::string composePrompt ()
63
int promptAdd (const std::string& context)
64
{
65
  contexts.push_back (context);
66
  return 0;
67
}
68
69
////////////////////////////////////////////////////////////////////////////////
70
std::string composeContexts (bool pretty /* = false */)
71
{
72
  std::string combined;
73
  for (unsigned int i = 0; i < contexts.size (); i++)
74
    if (pretty)
75
      combined += (combined != "" ? " " : "")
76
                + std::string ("\001")
77
                + Color::colorize ("\002 " + contexts[i] + " \001", contextColors[i % contextColors.size ()])
78
                + "\002";
79
    else
80
      combined += (combined != "" ? " " : "") + contexts[i];
81
82
  if (combined != "")
83
    combined += ' ';
84
85
  return combined;
86
}
87
88
////////////////////////////////////////////////////////////////////////////////
89
std::string promptCompose ()
32
{
90
{
33
  // TODO The prompt may be composed of different elements:
91
  // TODO The prompt may be composed of different elements:
34
  // TODO - The configurable text
92
  // TODO - The configurable text
35
  // TODO - The accumulated context, as colored tokens.
93
  // TODO - The accumulated context, as colored tokens.
36
  // TODO - sync status
94
  // TODO - sync status
37
  // TODO - time
95
  // TODO - time
38
  return "task> ";
96
  auto decoration = composeContexts (true);
97
  if (decoration.length ())
98
    return "task " + decoration + "> ";
99
100
  return "tasksh> ";
39
}
101
}
40
102
41
////////////////////////////////////////////////////////////////////////////////
103
////////////////////////////////////////////////////////////////////////////////

Return to bug 46407