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

Commit 0edbf93

Browse files
committed
Merge branch 'next'
2 parents 0e1687e + 5e6cb8b commit 0edbf93

File tree

77 files changed

+2604
-798
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2604
-798
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,7 @@ dependency-reduced-pom.xml
2828
# our tmc-cli log files
2929
/logs/
3030

31-
tmc-langs.logl
31+
tmc-langs.log
32+
/.classpath
33+
/.project
34+
/.settings

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,14 @@ Once installation is complete, you can log in using `tmc login`. This saves your
8181
server address:
8282
username:
8383
password:
84-
Login successful.
84+
Choose organization by writing its slug:
85+
Do you want to send crash reports for client development? (Y/n)
86+
Do you want to send analytics data for research? (Y/n)
8587
```
8688

89+
You can change your organization with the command `organization`. Use the option `-o` and give the slug of an organization as an argument. Otherwise all available organizations will be listed.
90+
You can inspect and change your settings such as sending data with the command `config`. Use the option `-l` to see your current settings and give `[KEY]=[NEW VALUE]` as arguments to change them.
91+
8792
## Listing courses
8893

8994
Once you have logged in, you can list all the available courses on the server with `tmc courses`.
@@ -96,7 +101,7 @@ c-mooc
96101
javascript-for-lazy-hipsters
97102
```
98103

99-
Note that you can only submit exercises on courses for which you have enrolled.
104+
Note that you can only exercises on courses for which you have enrolled.
100105

101106
## Downloading courses
102107

@@ -127,7 +132,7 @@ All tests passed! Submit to server with 'tmc submit'
127132

128133
## Submitting exercises
129134

130-
You have now completed your first exercise! To submit your exercise, run `tmc submit`. The syntax is the same as for running tests.
135+
You have now completed your first exercise! To submit your exercise, run `tmc submit [exercise-name]` or run `tmc submit` in an exercise directory. The syntax is the same as for running tests.
131136

132137
```
133138
~/tmc-courses/test-course/exercise1 $ tmc submit

docs/HACKING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,14 @@ public class ExampleCommandTest {
105105

106106
If you are doing tests for any other class, simply create normal unit tests that don't depend on any command.
107107

108-
##Adding properties
108+
## Adding properties
109109

110110
Properties are saved as a Java `HashMap<String, String>`. They are read from ~/.config/tmc-cli/properties.json on initialisation. The purpose of the properties file is to provide a backwards- and forwards-compatible method of storing user preferences and internal data. Properties can be accessed via the `CliContext` class method getProperties(). Remember to store any changes to the properties with saveProperties(). Feel free to create new properties, but please document *all* properties in the 'COMMAND: PROP'-section of MANUAL.md.
111111

112-
##Updating the documentation
112+
## Updating the documentation
113113

114114
Please document any new features or revisions in MANUAL.md and HISTORY.md as well as README.md, if the affected feature is already documented there.
115115

116116
If you make changes to MANUAL.md, please rebuild tmc.1 with [md2man](https://github.com/sunaku/md2man) before you push your changes. Use `md2man-roff docs/MANUAL.md > docs/tmc.1` to build the manpage.
117117

118-
There are no strict guidelines for README.md or MANUAL.md, but please try not to deviate from the original style (eg. new command sections should follow the same pattern).
118+
There are no strict guidelines for README.md or MANUAL.md, but please try not to deviate from the original style (eg. new command sections should follow the same pattern).

docs/MANUAL.md

Lines changed: 65 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -40,62 +40,59 @@ OPTIONS
4040
---
4141
COMMANDS
4242
---
43-
43+
4444
---
4545

4646
COMMAND: LOGIN
4747
-----
4848

49-
`tmc` `login` [`-s` *server address*] [`-u` *username*] [`-p` *password*]
49+
`tmc` `login` [`-u` *username*] [`-p` *password*]
5050

5151
Login to TMC server. If credentials are not given as options, the user will
5252
be asked to input any missing credentials. You will have to be logged in
5353
in order to use certain commands.
54-
55-
`-s` `--server`
56-
Specify which server to connect to.
57-
54+
5855
`-u` `--user`
5956
Specify username.
60-
57+
6158
`-p` `--password`
6259
Specify password.
63-
60+
6461
COMMAND: LOGOUT
6562
---------------
6663

6764
`tmc` `logout`
6865

6966
Delete login credentials from configurations.
70-
67+
7168
COMMAND: COURSES
7269
----------------
7370

7471
`tmc` `courses`
7572

7673
List all available courses on the server.
77-
74+
7875
COMMAND: DOWNLOAD
7976
-----------------
80-
77+
8178
`tmc` `download` [`-a`] *course*
8279

8380
Download a course from the server.
84-
81+
8582
`-a` `--all`
8683
Download all exercises, including completed ones.
87-
84+
8885
COMMAND: EXERCISES
8986
------------------
9087

9188
`tmc` `exercises` [`-n`] [`-i`]
9289

9390
List the status of all of the course's exercises. Exercises are grouped by
9491
their deadlines. On Unix, the list is displayed on a pager.
95-
92+
9693
`-n` `--no-pager`
9794
Print the list directly to the terminal.
98-
95+
9996
`-i` `--internet`
10097
Fetch exercises' statuses from the server, as opposed to reading from the
10198
local cache.
@@ -106,7 +103,7 @@ COMMAND: UPDATE
106103
`tmc` `update`
107104

108105
Update the course cache and download newly available exercises.
109-
106+
110107
COMMAND: TEST
111108
-------------
112109

@@ -116,7 +113,7 @@ Run tests for the specified exercise. If no *path* is given, tests will be
116113
run in the current working directory. Several exercises can be tested at once.
117114
If the current work directory is the course root directory or the course root
118115
directory was given as a *path*, then all exercises will be tested.
119-
116+
120117
`-a` `--all`
121118
Display all test results, instead of only the failed tests.
122119

@@ -129,23 +126,21 @@ COMMAND: SUBMIT
129126
`tmc` `submit` [`-a`] [`-d`] [`-c`] [*path*] ...
130127

131128
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.
129+
current working directory will be submitted. The submittable exercise(s) must be given as an argument.
135130

136131
For every successful submission, you'll be prompted to send feedback for the
137-
exercise if the course has enabledfeedback questions. Sending feedback is
132+
exercise if the course has enabled feedback questions. Sending feedback is
138133
always optional.
139-
134+
140135
`-a` `--all`
141136
Display all test results, instead of only the failed tests.
142-
137+
143138
`-d` `--details`
144139
Display more detailed error messages.
145-
140+
146141
`-c` `--completed`
147142
Submit all exercises in the current course which have passed local tests.
148-
143+
149144
COMMAND: INFO
150145
-------------
151146

@@ -154,7 +149,7 @@ COMMAND: INFO
154149
Display the current status of a course or an exercise. If used for a course,
155150
shows the total amount of available, completed and locked exercises. If used
156151
for an exercise, shows the exercise's status and deadline.
157-
152+
158153
`-a` `--all`
159154
Displays all information for given course and exercises.
160155

@@ -174,30 +169,55 @@ Once submission is successful, a shareable link will be printed.
174169

175170
`-n` `--no-message`
176171
Do not send a message alongside the paste.
177-
172+
178173
`-m` `--message`
179174
Give the message as an argument instead of opening a text editor.
180175

181-
COMMAND: PROP
176+
COMMAND: CONFIG
182177
-------------
183178

184-
`tmc` `prop` [*KEY*] [*VALUE*] ...
185-
`prop` `-u` *KEY* ...
179+
`tmc` `config` `[-q]`[*KEY=VALUE*] ...
180+
`config` `-d` `[-q]` [*KEY*] ...
181+
`config` `-l`
182+
`config` `-g` [*KEY*] or `-g`=[*KEY*]
186183

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`
184+
Set or unset TMC-CLI properties. Only accepts certain keys. If not invoked with the option `quiet` will ask to confirm changes.
185+
186+
`-d` `--delete`
192187
Unset given properties.
193-
194-
List of properties:
195-
188+
189+
`-q` `--quiet`
190+
Do not ask for confirmations or print out set values.
191+
192+
`-l` `--list`
193+
List all current settings.
194+
195+
`-g` `--get=KEY` or `--get KEY`
196+
Get the value of a specific key.
197+
198+
List of configurable settings:
199+
196200
* *update-date*
197-
Scheduled time for the next version check.
201+
Scheduled time for the next version check. Stored in properties.
198202
* *testresults-left* *testresults-right* *progressbar-left* *progressbar-right*
199203
Change progress bar colours. Recognised values: black, red, green, yellow,
200-
blue, purple, cyan, white, none.
204+
blue, purple, cyan, white, none. Stored in properties.
205+
* *send-diagnostics*
206+
Allow sending crash reports and analytics for client development. Stored with account.
207+
* *send-analytics*
208+
Allow sending analytics data of commands run. Stored in account.
209+
* *server-address*
210+
Address to fetch courses from and submit to. Defaults to `https://tmc.mooc.fi`. Stored with account. Changing the server address will log the user out and prompt a new login.
211+
212+
COMMAND: ORGANIZATION
213+
---------------
214+
215+
`tmc` `organization` [`-o`][*slug*] ...
216+
217+
Change organization, which determines the downloadable courses. If no slug is given, or the slug is invalid, all available organizations are listed, and the user will be prompted to choose one.
218+
219+
`-o` `--organization`
220+
Change organization to slug given as an argument without the listing of all organizations.
201221

202222
---
203223

@@ -207,17 +227,17 @@ FILES
207227
`[course directory]/.tmc.json`
208228
Course configuration and cache file. Saves the status of the username, server
209229
address and course's exercises. Manually editing this file may have adverse
210-
effects.
230+
effects.
211231

212232
`~/.config/tmc-cli/properties.json`
213233
User configuration file. Use `tmc prop` to edit properties.
214234

215235
`~/.config/tmc-cli/accounts.json`
216236
User login credentials. Use `tmc logout` to safely delete.
217-
237+
218238
`~/.config/tmc-cli/logs/tmc-cli.log`
219239
Debug logging.
220-
240+
221241
For more on config locations, see `ENVIRONMENT` -> `XDG_CONFIG_HOME` and `APPDATA`.
222242

223243
ENVIRONMENT
@@ -230,10 +250,10 @@ ENVIRONMENT
230250
`PAGER`
231251
Pager for displaying text files. If unset, defaults to `less -R` on Unix.
232252
This functionality is broken on Windows, but defaults to `more`.
233-
253+
234254
`XDG_CONFIG_HOME`
235255
If set on Unix, *~/.config/* in config file paths is replaced with its value.
236-
256+
237257
`APPDATA`
238258
On Windows, *~/.config/* is replaced with the value of `%APPDATA%`, usually
239259
*C:\\Users\\Username\\AppData\\Roaming\\.* If `%APPDATA%` is unset, user's home

0 commit comments

Comments
 (0)