diff --git a/README.md b/README.md index 11d76a2..ca31a94 100644 --- a/README.md +++ b/README.md @@ -18,13 +18,16 @@ A CLI for Toggl Track USAGE $ track [COMMAND] +TOPICS + set Set your config individually. + COMMANDS autocomplete Display autocomplete installation instructions. - config Get your config for track CLI. + config Get your config for track. continue Continue with last time entry. current Show running time entry. help Display help for track. - setup Setup the CLI. + setup Setup your config for track. start Start a new time entry. stop Stop running time entry. today Show time entries run today. @@ -35,6 +38,14 @@ COMMANDS # Commands * [`track config`](#track-config) +* [`track continue`](#track-continue) +* [`track current`](#track-current) +* [`track setup`](#track-setup) +* [`track start`](#track-start) +* [`track stop`](#track-stop) +* [`track today`](#track-today) +* [`track week`](#track-week) +* [`track yesterday`](#track-yesterday) ## `track config` @@ -53,7 +64,23 @@ EXAMPLES $ track config ``` -_See code: [src/commands/config/config.ts](https://github.com/ulisesantana/track/blob/v0.0.0/src/commands/config/index.ts)_ +_See code: [src/commands/config.ts](https://github.com/ulisesantana/track/blob/v0.0.0/src/commands/config.ts)_ - +Continue with last time entry. + + ``` +USAGE + $ track continue +_See code: [src/commands/current/current.ts]_ + +## `track help` + +Display help for track. + + ``` +USAGE + $ track help +_See code: [src/commands/start/start.ts]_ + + diff --git a/src/commands/config.ts b/src/commands/config.ts index 9614cf5..e0d38f0 100644 --- a/src/commands/config.ts +++ b/src/commands/config.ts @@ -7,7 +7,7 @@ import {FileSystemDataSource} from "../infrastructure/data-sources"; import {ConfigurationRepositoryImplementation} from "../infrastructure/repositories"; export default class Config extends Command { - static description = 'Get your config for track CLI.' + static description = 'Get your config for track.' static examples = [ '<%= config.bin %> <%= command.id %>', @@ -18,7 +18,7 @@ export default class Config extends Command { const useCase = new GetConfigurationUseCase(configurationRepository) try { const config = await useCase.exec() - this.log('Your config for track CLI:') + this.log('Your config for track:') for (const [key, value] of Object.entries(config)) { this.log(` - ${key}: ${value}`) } diff --git a/src/commands/set/description.ts b/src/commands/set/description.ts index 7a1afb4..df863cd 100644 --- a/src/commands/set/description.ts +++ b/src/commands/set/description.ts @@ -7,7 +7,7 @@ import {ConfigurationRepositoryImplementation} from "../../infrastructure/reposi import Setup from "../setup"; export default class SetDescription extends Command { - static description = 'Set your default time entry description for track CLI.' + static description = 'Set your default time entry description for track.' static examples = [ '<%= config.bin %> <%= command.id %>', diff --git a/src/commands/set/project.ts b/src/commands/set/project.ts index bc63c66..db8e6ce 100644 --- a/src/commands/set/project.ts +++ b/src/commands/set/project.ts @@ -7,19 +7,12 @@ import {ConfigurationRepositoryImplementation} from "../../infrastructure/reposi import Setup from "../setup"; export default class SetProject extends Command { - static description = 'Setup your default project for track CLI.' + static description = 'Setup your default project for track.' static examples = [ '<%= config.bin %> <%= command.id %>', ] - private static sortByName = (a: { name: string }, b: { name: string }) => - a.name > b.name - ? 1 - : a.name < b.name - ? -1 - : 0 - public async run(): Promise { const configurationRepository = new ConfigurationRepositoryImplementation(new FileSystemDataSource(path.join(this.config.configDir, configFilename))) try { diff --git a/src/commands/set/token.ts b/src/commands/set/token.ts index 61ae524..cb7647d 100644 --- a/src/commands/set/token.ts +++ b/src/commands/set/token.ts @@ -7,7 +7,7 @@ import {ConfigurationRepositoryImplementation} from "../../infrastructure/reposi import Setup from "../setup"; export default class SetToken extends Command { - static description = 'Setup your Toggl Track API token for track CLI.' + static description = 'Setup your Toggl Track API token for track.' static examples = [ '<%= config.bin %> <%= command.id %>', diff --git a/src/commands/set/workspace.ts b/src/commands/set/workspace.ts index c3b7126..f371f58 100644 --- a/src/commands/set/workspace.ts +++ b/src/commands/set/workspace.ts @@ -7,19 +7,12 @@ import {ConfigurationRepositoryImplementation} from "../../infrastructure/reposi import Setup from "../setup"; export default class SetWorkspace extends Command { - static description = 'Setup your default workspace for track CLI.' + static description = 'Setup your default workspace for track.' static examples = [ '<%= config.bin %> <%= command.id %>', ] - private static sortByName = (a: { name: string }, b: { name: string }) => - a.name > b.name - ? 1 - : a.name < b.name - ? -1 - : 0 - public async run(): Promise { const configurationRepository = new ConfigurationRepositoryImplementation(new FileSystemDataSource(path.join(this.config.configDir, configFilename))) try { diff --git a/src/commands/setup.ts b/src/commands/setup.ts index 6ddea3c..b896d57 100644 --- a/src/commands/setup.ts +++ b/src/commands/setup.ts @@ -8,7 +8,7 @@ import {FileSystemDataSource, TogglApi, UserInfo, http} from "../infrastructure/ import {ConfigurationRepositoryImplementation} from "../infrastructure/repositories"; export default class Setup extends Command { - static description = 'Setup your config for track CLI.' + static description = 'Setup your config for track.' static examples = [ '<%= config.bin %> <%= command.id %>', @@ -82,7 +82,7 @@ export default class Setup extends Command { await Setup.setDefaultProject(userInfo, configurationRepository); // Add your default time entry description await Setup.setDefaultTimeEntryDescription(configurationRepository); - this.log('Your config for track CLI has been setup.') + this.log('Your config for track has been setup.') } catch (error) { this.log(`There was an error trying to setting up your config. Detailed error:`) this.log(`${error}`)