Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 50f35a8

Browse files
author
Aleksi Salmela
committed
Merge branch 'master' of https://github.com/tmc-cli/tmc-cli into fix-certificate-problem-aleksi
2 parents 01999ca + 92a5fc0 commit 50f35a8

File tree

14 files changed

+730
-56
lines changed

14 files changed

+730
-56
lines changed

HISTORY.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,21 @@ If for some reason the alias was not added to your .bashrc or your shell of choi
4242

4343
If you are using Windows and you downloaded the .jar file, you must use tmc-cli directly with Java like so: `java -jar [path_to_tmc-cli.jar]`. In the following examples, replace `tmc` with this command. (note: you must have set Java on your system `%PATH%`. For more information, see [this Java help page](https://www.java.com/en/download/help/path.xml).)
4444

45-
Tip: On Windows, use `doskey tmc="java - jar [path_to_tmc-cli.jar] $@"` to get a convenient alias
45+
Tip: On Windows, use `doskey tmc="java - jar [path_to_tmc-cli.jar] $@"` to create a convenient alias.
4646

4747
Now that you've installed tmc-cli, you can view all available commands by running tmc without arguments or with `tmc --help`. You can also view all available options for commands by running them with the `--help` switch, for example `tmc courses --help`.
4848

49+
##Manual
50+
51+
The Unix man page for tmc-cli is located in docs/tmc.1 in this repository. To view it, open it with `man -l tmc.1`.
52+
53+
The man page is generated from docs/MANUAL.md using [md2man](https://github.com/sunaku/md2man).
54+
55+
For system administrators/packagers: To make the man page available for all users, move it to /usr/share/man/man1 - then it can be displayed with `man tmc`.
56+
4957
##Logging in
5058

51-
Once installation is complete, you can log in using `tmc login`. This saves your TMC login information to a configuration file in ~/.config/tmc-cli/ (or %LOCALAPPDATA% on Windows) - you will only have to log in once.
59+
Once installation is complete, you can log in using `tmc login`. This saves your TMC login information to a configuration file in ~/.config/tmc-cli/ (or %APPDATA% on Windows) - you will only have to log in once.
5260
```
5361
~ $ tmc login
5462
server address:
File renamed without changes.

docs/HISTORY.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
0.6.3 / 28.6.2016
2+
=================
3+
4+
* Release for demo
5+
* Bug fixes and polish
6+
7+
0.6.1 / 23.6.2016
8+
=================
9+
10+
* Feedback can be sent
11+
* download -command doesn't download locked exercises (by default)
12+
* Bug fixes
13+
* Known issues:
14+
* External programs such as text editor and pager cannot be opened on Windows, with the exception of the default internet browser
15+
* On some systems, progress bars print ? instead of the intended character
16+
17+
0.6.0 / 22.6.2016
18+
=================
19+
20+
* exercises -command has an -a option
21+
* Valgrind errors are now printed
22+
* The colours for progress bars and test results can be changed
23+
* All locally tested exercises can be submitted with submit -c
24+
25+
0.5.2 / 21.6.2016
26+
=================
27+
28+
* Supports custom colors in progress bars and submit command
29+
* Info command works without arguments
30+
* Download only exercises that aren't completed
31+
* Info and exercises commands won't need internet connection any more
32+
* Ask user if they want to put message to paste
33+
* Login command asks now always the server
34+
* Properties command prints now the keys in sorted order
35+
36+
0.5.1 / 17.6.2016
37+
=================
38+
39+
* Auto-complete file paths
40+
* Internal properties can be set with prop command
41+
* Progress bar looks little bit nicer
42+
43+
0.5.0 / 16.6.2016
44+
=================
45+
46+
* Improved unit testing
47+
* Course info command created
48+
* Logout command created
49+
50+
0.4.2 / 9.6.2016
51+
================
52+
53+
* Fixed a tmc-langs related issue where the submitted exercise wouldn't compile on server
54+
55+
0.3.0 / 23.5.2016
56+
=================
57+
58+
* Command created for code pastes
59+
* Exercises can be submitted
60+
* Tests can be run locally
61+
* Submission results are printed nicely
62+
* Bug fixes
63+
64+
0.2.0 / 23.5.2016
65+
=================
66+
67+
* Allow user to list courses.
68+
* Support listing excersices.
69+
* Create help command
70+
* Return the version numbrer with -v flag
71+
72+
0.1.0 / 16.5.2016
73+
=================
74+
75+
* Initial release

docs/MANUAL.md

Lines changed: 256 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,256 @@
1+
TMC-CLI 1 2016-06-30 "Helsinki Univ. Dep. of CS" "TMC-CLI Manual"
2+
=================================================================
3+
4+
NAME
5+
----
6+
7+
tmc - Command-line client for TestMyCode
8+
9+
SYNOPSIS
10+
--------
11+
12+
`tmc` [`-h|--help`] [`-v|--version`]
13+
<`COMMAND`> [`-h|--help`]
14+
<`COMMAND`> [`arguments`] ...
15+
16+
DESCRIPTION
17+
-----------
18+
19+
`tmc` is an exercise testing and submission utility for students participating
20+
on online courses utilising the free and open TestMyCode-framework. TMC-CLI is
21+
a command-line interface for TMC-CORE, the TestMyCode client backend. TMC-CLI's
22+
primary features include downloading exercises, running tests, viewing progress
23+
and submitting completed exercises.
24+
25+
All functionality is divided between different commands. To use `tmc` for any
26+
meaningful task, you must issue a command after `tmc`. Commands each have their own
27+
options. For more information on commands and their options, see the `COMMAND`
28+
sections below.
29+
30+
OPTIONS
31+
-------
32+
33+
`-v` `--version`
34+
Display the version of this build.
35+
36+
`-h` `--help`
37+
Display a concise help message. Shows all commonly used commands. If issued
38+
with a command, display a help message for that command.
39+
40+
---
41+
COMMANDS
42+
---
43+
44+
---
45+
46+
COMMAND: LOGIN
47+
-----
48+
49+
`tmc` `login` [`-s` *server address*] [`-u` *username*] [`-p` *password*]
50+
51+
Login to TMC server. If credentials are not given as options, the user will
52+
be asked to input any missing credentials. You will have to be logged in
53+
in order to use certain commands.
54+
55+
`-s` `--server`
56+
Specify which server to connect to.
57+
58+
`-u` `--user`
59+
Specify username.
60+
61+
`-p` `--password`
62+
Specify password.
63+
64+
COMMAND: LOGOUT
65+
---------------
66+
67+
`tmc` `logout`
68+
69+
Delete login credentials from configurations.
70+
71+
COMMAND: COURSES
72+
----------------
73+
74+
`tmc` `courses`
75+
76+
List all available courses on the server.
77+
78+
COMMAND: DOWNLOAD
79+
-----------------
80+
81+
`tmc` `download` [`-a`] *course*
82+
83+
Download a course from the server.
84+
85+
`-a` `--all`
86+
Download all exercises, including completed ones.
87+
88+
COMMAND: EXERCISES
89+
------------------
90+
91+
`tmc` `exercises` [`-n`] [`-i`]
92+
93+
List the status of all of the course's exercises. Exercises are grouped by
94+
their deadlines. On Unix, the list is displayed on a pager.
95+
96+
`-n` `--no-pager`
97+
Print the list directly to the terminal.
98+
99+
`-i` `--internet`
100+
Fetch exercises' statuses from the server, as opposed to reading from the
101+
local cache.
102+
103+
COMMAND: UPDATE
104+
---------------
105+
106+
`tmc` `update`
107+
108+
Update the course cache and download newly available exercises.
109+
110+
COMMAND: TEST
111+
-------------
112+
113+
`tmc` `test` [`-a`] [`-d`] [*path*] ...
114+
115+
Run tests for the specified exercise. If no *path* is given, tests will be
116+
run in the current working directory. Several exercises can be tested at once.
117+
If the current work directory is the course root directory or the course root
118+
directory was given as a *path*, then all exercises will be tested.
119+
120+
`-a` `--all`
121+
Display all test results, instead of only the failed tests.
122+
123+
`-d` `--details`
124+
Display more detailed error messages.
125+
126+
COMMAND: SUBMIT
127+
---------------
128+
129+
`tmc` `submit` [`-a`] [`-d`] [`-c`] [*path*] ...
130+
131+
Submit exercises to the server. If no *path* is given, the exercise in the
132+
current working directory will be submitted. Several exercises can be submitted
133+
at once. If the current work directory is the course root directory or the
134+
course root directory was given as a *path*, then all exercises will be submitted.
135+
136+
For every successful submission, you'll be prompted to send feedback for the
137+
exercise if the course has enabledfeedback questions. Sending feedback is
138+
always optional.
139+
140+
`-a` `--all`
141+
Display all test results, instead of only the failed tests.
142+
143+
`-d` `--details`
144+
Display more detailed error messages.
145+
146+
`-c` `--completed`
147+
Submit all exercises in the current course which have passed local tests.
148+
149+
COMMAND: INFO
150+
-------------
151+
152+
`tmc` `info` [`-a`] [`-i`] [*course or exercise*]
153+
154+
Display the current status of a course or an exercise. If used for a course,
155+
shows the total amount of available, completed and locked exercises. If used
156+
for an exercise, shows the exercise's status and deadline.
157+
158+
`-a` `--all`
159+
Displays all information for given course and exercises.
160+
161+
`-i` `--internet`
162+
Fetches information from the server, as opposed to reading from local cache.
163+
164+
COMMAND: PASTE
165+
--------------
166+
167+
`tmc` `paste` [`-o`] [`-n`] [`-m` *message*] [*exercise*]
168+
169+
Submit an exercise to the tmc-pastebin. You can attach a message to your paste.
170+
Once submission is successful, a shareable link will be printed.
171+
172+
`-o` `--open`
173+
Open the link to the paste in the default internet browser after submission.
174+
175+
`-n` `--no-message`
176+
Do not send a message alongside the paste.
177+
178+
`-m` `--message`
179+
Give the paste as an argument instead of opening a text editor.
180+
181+
COMMAND: PROP
182+
-------------
183+
184+
`tmc` `prop` [*KEY*] [*VALUE*] ...
185+
`prop` `-u` *KEY* ...
186+
187+
Set or unset TMC-CLI properties. Invoke without any arguments to display all
188+
current properties. If more than a single property is added or removed, the user
189+
will be asked to confirm the changes.
190+
191+
`-u` `--unset`
192+
Unset given properties.
193+
194+
List of properties:
195+
196+
* *update-date*
197+
Scheduled time for the next version check.
198+
* *testresults-left* *testresults-right* *progressbar-left* *progressbar-right*
199+
Change progress bar colours. Recognised values: black, red, green, yellow,
200+
blue, purple, cyan, white, none.
201+
202+
---
203+
204+
FILES
205+
-----
206+
207+
`[course directory]/.tmc.json`
208+
Course configuration and cache file. Saves the status of the username, server
209+
address and course's exercises. Manually editing this file may have adverse
210+
effects.
211+
212+
213+
`~/.config/tmc-cli/properties.json`
214+
User configuration file. Use `tmc prop` to edit properties.
215+
216+
`~/.config/tmc-cli/accounts.json`
217+
User login credentials. Use `tmc logout` to safely delete.
218+
219+
`~/.config/tmc-cli/logs/tmc-cli.log`
220+
Debug logging.
221+
222+
For more on config locations, see `ENVIRONMENT` -> `XDG_CONFIG_HOME` and `APPDATA`.
223+
224+
ENVIRONMENT
225+
-----------
226+
227+
`EDITOR`
228+
Text editor for editing messages for pastebin and feedback. If unset, defaults
229+
to `nano` on Unix and `notepad` on Windows.
230+
231+
`PAGER`
232+
Pager for displaying text files. If unset, defaults to `less -R` on Unix.
233+
This functionality is broken on Windows, but defaults to `more`.
234+
235+
`XDG_CONFIG_HOME`
236+
If set on Unix, *~/.config/* in config file paths is replaced with its value.
237+
238+
`APPDATA`
239+
On Windows, *~/.config/* is replaced with the value of `%APPDATA%`, usually
240+
*C:\\Users\\Username\\AppData\\Roaming\\.* If `%APPDATA%` is unset, user's home
241+
directory will be used instead.
242+
243+
BUGS
244+
----
245+
246+
Most likely. Please submit bug reports, spelling and grammar corrections and
247+
other issues to [the tmc-cli issue tracker](https://github.com/tmc-cli/tmc-cli/issues).
248+
249+
AUTHORS
250+
-------
251+
252+
Johannes L. [jclc](https://github.com/jclc)
253+
Matti L. [matike](https://github.com/matike)
254+
Mikko M. [mikkomaa](https://github.com/mikkomaa)
255+
Aleksi S. [salmela](https://github.com/salmela)
256+
Juha V. [juvester](https://github.com/juvester)

0 commit comments

Comments
 (0)