dsu 2.4.4 → 3.0.0.alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +12 -0
  3. data/CHANGELOG.md +42 -0
  4. data/Gemfile.lock +1 -1
  5. data/README.md +2 -2
  6. data/Rakefile +6 -0
  7. data/current_project.bak +4 -0
  8. data/lib/dsu/cli.rb +24 -6
  9. data/lib/dsu/crud/json_file.rb +3 -0
  10. data/lib/dsu/migration/version.rb +1 -1
  11. data/lib/dsu/models/color_theme.rb +7 -58
  12. data/lib/dsu/models/configuration.rb +18 -3
  13. data/lib/dsu/models/entry_group.rb +0 -7
  14. data/lib/dsu/models/migration_version.rb +0 -1
  15. data/lib/dsu/models/project.rb +295 -0
  16. data/lib/dsu/presenters/base_presenter_ex.rb +1 -12
  17. data/lib/dsu/presenters/export/all_presenter.rb +14 -19
  18. data/lib/dsu/presenters/export/dates_presenter.rb +17 -20
  19. data/lib/dsu/presenters/import/all_presenter.rb +20 -25
  20. data/lib/dsu/presenters/import/dates_presenter.rb +25 -27
  21. data/lib/dsu/presenters/import/import_entry.rb +22 -0
  22. data/lib/dsu/presenters/import/import_file.rb +9 -1
  23. data/lib/dsu/presenters/project/create_presenter.rb +44 -0
  24. data/lib/dsu/presenters/project/delete_by_number_presenter.rb +54 -0
  25. data/lib/dsu/presenters/project/delete_presenter.rb +53 -0
  26. data/lib/dsu/presenters/project/list_presenter.rb +24 -0
  27. data/lib/dsu/presenters/project/rename_by_number_presenter.rb +63 -0
  28. data/lib/dsu/presenters/project/rename_presenter.rb +57 -0
  29. data/lib/dsu/presenters/project/use_by_number_presenter.rb +53 -0
  30. data/lib/dsu/presenters/project/use_presenter.rb +52 -0
  31. data/lib/dsu/services/entry_group/exporter_service.rb +22 -5
  32. data/lib/dsu/services/entry_group/importer_service.rb +41 -8
  33. data/lib/dsu/services/project/hydrator_service.rb +40 -0
  34. data/lib/dsu/services/project/rename_service.rb +70 -0
  35. data/lib/dsu/subcommands/export.rb +4 -2
  36. data/lib/dsu/subcommands/import.rb +7 -3
  37. data/lib/dsu/subcommands/project.rb +149 -0
  38. data/lib/dsu/support/ask.rb +10 -3
  39. data/lib/dsu/support/color_themable.rb +1 -1
  40. data/lib/dsu/support/command_hookable.rb +7 -2
  41. data/lib/dsu/support/descriptable.rb +5 -21
  42. data/lib/dsu/support/fileable.rb +39 -1
  43. data/lib/dsu/support/project_file_system.rb +121 -0
  44. data/lib/dsu/support/short_string.rb +24 -0
  45. data/lib/dsu/support/time_comparable.rb +2 -0
  46. data/lib/dsu/support/transform_project_name.rb +24 -0
  47. data/lib/dsu/validators/project_name_validator.rb +58 -0
  48. data/lib/dsu/version.rb +1 -1
  49. data/lib/dsu/views/base_list_view.rb +41 -0
  50. data/lib/dsu/views/export.rb +60 -6
  51. data/lib/dsu/views/import.rb +83 -7
  52. data/lib/dsu/views/import_dates.rb +17 -0
  53. data/lib/dsu/views/project/create.rb +87 -0
  54. data/lib/dsu/views/project/delete.rb +96 -0
  55. data/lib/dsu/views/project/delete_by_number.rb +19 -0
  56. data/lib/dsu/views/project/list.rb +115 -0
  57. data/lib/dsu/views/project/rename.rb +98 -0
  58. data/lib/dsu/views/project/rename_by_number.rb +21 -0
  59. data/lib/dsu/views/project/use.rb +97 -0
  60. data/lib/dsu/views/project/use_by_number.rb +19 -0
  61. data/lib/dsu.rb +2 -10
  62. data/lib/locales/en/active_record.yml +9 -0
  63. data/lib/locales/en/commands.yml +9 -3
  64. data/lib/locales/en/miscellaneous.yml +4 -0
  65. data/lib/locales/en/services.yml +4 -0
  66. data/lib/locales/en/subcommands.yml +247 -15
  67. data/project.bak +0 -0
  68. metadata +34 -9
  69. data/lib/dsu/presenters/export/messages.rb +0 -32
  70. data/lib/dsu/presenters/export/nothing_to_export.rb +0 -13
  71. data/lib/dsu/presenters/export/service_callable.rb +0 -20
  72. data/lib/dsu/presenters/import/messages.rb +0 -42
  73. data/lib/dsu/presenters/import/service_callable.rb +0 -21
@@ -0,0 +1,97 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../env'
4
+ require_relative '../../models/color_theme'
5
+ require_relative '../../support/ask'
6
+ require_relative '../../support/color_themable'
7
+
8
+ module Dsu
9
+ module Views
10
+ module Project
11
+ class Use
12
+ include Support::Ask
13
+ include Support::ColorThemable
14
+
15
+ attr_reader :presenter
16
+
17
+ def initialize(presenter:, options: {})
18
+ @presenter = presenter
19
+ @options = options&.dup || {}
20
+ @color_theme = Models::ColorTheme.find(theme_name: theme_name)
21
+ end
22
+
23
+ def render
24
+ return display_project_does_not_exist if presenter.project_does_not_exist?
25
+ return display_project_already_current_project if presenter.already_current_project?
26
+ return display_project_errors if presenter.project_errors.any?
27
+
28
+ response = display_project_use_prompt
29
+ if presenter.respond response: response
30
+ display_using_project_message
31
+ else
32
+ display_use_project_cancelled_message
33
+ end
34
+ rescue StandardError => e
35
+ puts apply_theme(e.message, theme_color: color_theme.error)
36
+ puts apply_theme(e.backtrace_locations.join("\n"), theme_color: color_theme.error) if Dsu.env.local?
37
+ end
38
+
39
+ private
40
+
41
+ attr_reader :color_theme, :options
42
+
43
+ def display_project_use_prompt
44
+ response = ask_while(prompt_with_options(prompt: use_prompt,
45
+ options: use_prompt_options), options: options) do |input|
46
+ message = I18n.t('information.input.try_again', options: use_prompt_options.join(','))
47
+ puts apply_theme(message, theme_color: color_theme.info) unless use_prompt_options.include?(input)
48
+ use_prompt_options.include?(input)
49
+ end
50
+ response == use_prompt_options.first
51
+ end
52
+
53
+ def display_use_project_cancelled_message
54
+ message = I18n.t('subcommands.project.messages.cancelled')
55
+ puts apply_theme(message, theme_color: color_theme.info)
56
+ end
57
+
58
+ def display_project_errors
59
+ errors = presenter.project_errors.join("\n")
60
+ puts apply_theme(errors, theme_color: color_theme.error)
61
+ end
62
+
63
+ def display_project_does_not_exist
64
+ message = I18n.t('subcommands.project.messages.does_not_exist',
65
+ project_name: presenter.project_name)
66
+ puts apply_theme(message, theme_color: color_theme.error)
67
+ end
68
+
69
+ def display_using_project_message
70
+ message = I18n.t('subcommands.project.use.messages.using_project',
71
+ project_name: presenter.project_name)
72
+ puts apply_theme(message, theme_color: color_theme.success)
73
+ end
74
+
75
+ def display_project_already_current_project
76
+ message = I18n.t('subcommands.project.messages.already_current_project',
77
+ project_name: presenter.project_name)
78
+ puts apply_theme(message, theme_color: color_theme.success)
79
+ end
80
+
81
+ def use_prompt
82
+ I18n.t('subcommands.project.use.prompts.use_confirm',
83
+ project_name: presenter.project_name,
84
+ description: presenter.project_description)
85
+ end
86
+
87
+ def use_prompt_options
88
+ I18n.t('subcommands.project.use.prompts.use_options')
89
+ end
90
+
91
+ def theme_name
92
+ @theme_name ||= options.fetch(:theme_name, Models::Configuration.new.theme_name)
93
+ end
94
+ end
95
+ end
96
+ end
97
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'use'
4
+
5
+ module Dsu
6
+ module Views
7
+ module Project
8
+ class UseByNumber < Use
9
+ private
10
+
11
+ def display_project_does_not_exist
12
+ message = I18n.t('subcommands.project.messages.number_does_not_exist',
13
+ project_number: presenter.project_number)
14
+ puts apply_theme(message, theme_color: color_theme.error)
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
data/lib/dsu.rb CHANGED
@@ -33,14 +33,6 @@ unless Dsu.env.test? || Dsu.env.development?
33
33
  exit 1
34
34
  end
35
35
  end
36
- # TODO: Hack. Integrate this into the migration service
37
- # so that this runs only if the migration version changes.
38
- %w[light.json christmas.json].each do |theme_file|
39
- destination_theme_file_path = File.join(Dsu::Support::Fileable.themes_folder, theme_file)
40
- next if File.exist?(destination_theme_file_path)
41
-
42
- source_theme_file_path = File.join(Dsu::Support::Fileable.seed_data_folder, 'themes', theme_file)
43
- FileUtils.cp(source_theme_file_path, destination_theme_file_path)
44
- puts I18n.t('migrations.information.theme_copied', from: source_theme_file_path, to: destination_theme_file_path)
45
- end
36
+
37
+ Migration::Factory.migrate_if!
46
38
  end
@@ -1,4 +1,13 @@
1
1
  en:
2
+ models:
3
+ project:
4
+ errors:
5
+ already_exists: "Project '%{project_name}' already exists."
6
+ delete_default_project: "Project '%{project_name}' is the default project. Change to a different default project before deleting this project."
7
+ delete_only_project: "Project '%{project_name}' is the only project and cannot be deleted."
8
+ does_not_exist: "Project '%{project_name}' does not exist."
9
+ new_project_already_exists: "Project cannot be renamed to '%{project_name}' because the project already exists."
10
+ project_file_not_exist: "Project file '%{project_file}' does not exist."
2
11
  activerecord:
3
12
  errors:
4
13
  models:
@@ -30,16 +30,18 @@ en:
30
30
  long_desc: |
31
31
  Will add a DSU entry having DESCRIPTION to the date associated with the given OPTION.
32
32
 
33
- $ dsu add [-d DATE|-n|-t|-y] DESCRIPTION
33
+ $ dsu add [-d DATE|MNEMONIC|-n|-t|-y] DESCRIPTION
34
34
 
35
- $ dsu a [-d DATE|-n|-t|-y] DESCRIPTION
35
+ $ dsu a [-d DATE|MNEMONIC|-n|-t|-y] DESCRIPTION
36
36
 
37
37
  OPTIONS:
38
38
 
39
- -d DATE: Adds a DSU entry having DESCRIPTION to the DATE.
39
+ -d DATE|MNEMONIC: Adds a DSU entry having DESCRIPTION to the DATE or date referenced by the MNEMONIC.
40
40
 
41
41
  %{date_option_description}
42
42
 
43
+ %{mnemonic_option_description}
44
+
43
45
  -n: Adds a DSU entry having DESCRIPTION to today's date (`Time.now`).
44
46
 
45
47
  -t: Adds a DSU entry having DESCRIPTION to tomorrow's date (`Time.new.tomorrow`).
@@ -98,6 +100,10 @@ en:
98
100
  key_mappings: l
99
101
  desc: list|l SUBCOMMAND
100
102
  usage: Displays DSU entries for the given SUBCOMMAND
103
+ project:
104
+ key_mappings: p
105
+ desc: project|p SUBCOMMAND
106
+ usage: Manage DSU projects for the given SUBCOMMAND
101
107
  theme:
102
108
  key_mappings: t
103
109
  desc: theme|t SUBCOMMAND
@@ -2,10 +2,12 @@ en:
2
2
  configuration:
3
3
  errors:
4
4
  theme_file_missing: Theme file "%{theme_path}" does not exist.
5
+ project_path_missing: Default project "%{project_folder}" does not exist.
5
6
  errors:
6
7
  error: "Error: %{message}"
7
8
  from_option_invalid: Option -f, [--from=DATE|MNEMONIC] value is invalid ["%{from_option}"]
8
9
  to_option_invalid: Option -t, [--to=DATE|MNEMONIC] value is invalid ["%{to_option}"]
10
+ project_name_invalid: Project name "%{project_name}" is invalid.
9
11
  headers:
10
12
  entry:
11
13
  could_not_be_added: "An error was encountered; the entry could not be added:"
@@ -19,6 +21,8 @@ en:
19
21
  information:
20
22
  dates:
21
23
  through: "%{from} thru %{to}"
24
+ input:
25
+ try_again: "Please try again. Valid options are [%{options}]."
22
26
  migrations:
23
27
  error:
24
28
  failed: "Error running migrations: %{message}"
@@ -8,3 +8,7 @@ en:
8
8
  Run `dsu help config` for more information.
9
9
  messages:
10
10
  editing: "Editing entry group %{formatted_time}..."
11
+ entry_group:
12
+ importer_service:
13
+ errors:
14
+ project_mismatch: The current project "%{current_project_name}" does not match the project "%{import_project_name}" being imported.
@@ -41,7 +41,7 @@ en:
41
41
  long_desc: |
42
42
  Deletes the configuration file.
43
43
 
44
- EXAMPLES:
44
+ EXAMPLES
45
45
 
46
46
  dsu config delete
47
47
 
@@ -54,7 +54,7 @@ en:
54
54
  long_desc: |
55
55
  Displays information about this gem configuration.
56
56
 
57
- EXAMPLES:
57
+ EXAMPLES
58
58
 
59
59
  $ dsu config info
60
60
  init:
@@ -63,7 +63,7 @@ en:
63
63
  long_desc: |
64
64
  Creates and initializes a .dsu file in your home folder (%{home_folder}) that may be edited.
65
65
 
66
- EXAMPLES:
66
+ EXAMPLES
67
67
 
68
68
  $ dsu config init
69
69
 
@@ -132,7 +132,7 @@ en:
132
132
 
133
133
  %{mnemonic_option_description}
134
134
 
135
- EXAMPLES:
135
+ EXAMPLES
136
136
 
137
137
  NOTE: All examples can substitute their respective short form options (e.g. `-f`, `-t`, etc. for `--from`, `--to`, etc.).
138
138
 
@@ -238,7 +238,7 @@ en:
238
238
 
239
239
  %{mnemonic_option_description}
240
240
 
241
- EXAMPLES:
241
+ EXAMPLES
242
242
 
243
243
  NOTE: All examples can substitute their respective short form options (e.g. `-f`, `-t`, etc. for `--from`, `--to`, etc.).
244
244
 
@@ -287,7 +287,7 @@ en:
287
287
  export_dates_confirm: Export all the entries for %{from} thru %{to} (%{count} entry groups)?
288
288
  options:
289
289
  - y
290
- - N
290
+ - n
291
291
  import:
292
292
  dates:
293
293
  desc: dates|dd OPTIONS
@@ -301,6 +301,8 @@ en:
301
301
 
302
302
  OPTIONS:
303
303
 
304
+ -o|--override true|false (default: false): If true, the import process will ignore the project name found in the import file and import the entries into the current project. If false, the import process will use the project name found in the import file.
305
+
304
306
  -i|--import-file IMPORT_CVS_FILE: The IMPORT_CVS_FILE file to import. IMPORT_CVS_FILE should be a fully qualified path to a file that was previously created as a result of running `dsu export`. see `dsu help export`.
305
307
 
306
308
  -m|--merge true|false (default: true): If true, imported entries will be added to the entry group if the entry group already exists. If false, the imported entries will replace all existing entries for the entry group if the entry group already exists. If the entry group does not exist, it will be created using the imported entries.
@@ -313,7 +315,13 @@ en:
313
315
 
314
316
  %{mnemonic_option_description}
315
317
 
316
- EXAMPLES:
318
+ NOTES
319
+
320
+ Entry groups in the import file whose project name does not match the current project, will be ignored (see `dsu project use`).
321
+
322
+ If the `--override` option is used, the import process will ignore the project name found in the import file and import the entries into the current project.
323
+
324
+ EXAMPLES
317
325
 
318
326
  NOTE: All examples can substitute their respective short form options (e.g. `-f`, `-t`, etc. for `--from`, `--to`, etc.).
319
327
 
@@ -343,6 +351,10 @@ en:
343
351
  This (assuming "today" is 5/23) will import the DSU entries back 1 week from yesterday's date 5/16 to 5/22, from the import file, and merge all the entries for the respective entry groups imported:
344
352
 
345
353
  $ dsu m dd --from yesterday --to -6 -i /path/to/import.csv
354
+
355
+ This (assuming the current year is 2024) will import the DSU entries for 1/1/2024 to 3/15/2024 from the import file, and ignore the project name found in the import file and import the entries into the current project:
356
+
357
+ $ dsu m dd -f 1/1 -t 3/15 -o true -i /path/to/import.csv
346
358
  all:
347
359
  desc: all|a OPTIONS
348
360
  usage: Imports all DSU entries from a given DSU export .csv file
@@ -355,31 +367,45 @@ en:
355
367
 
356
368
  OPTIONS:
357
369
 
370
+ -o|--override true|false (default: false): If true, the import process will ignore the project name found in the import file and import the entries into the current project. If false, the import process will use the project name found in the import file.
371
+
358
372
  -i|--import-file IMPORT_CVS_FILE: The IMPORT_CVS_FILE file to import. IMPORT_CVS_FILE should be a fully qualified path to a file that was previously created as a result of running `dsu export`. see `dsu help export`.
359
373
 
360
374
  -m|--merge true|false (default: true): If true, imported entries will be added to the entry group if the entry group already exists. If false, the imported entries will replace all existing entries for the entry group if the entry group already exists. If the entry group does not exist, it will be created using the imported entries.
361
375
 
362
- EXAMPLES:
376
+ NOTES
377
+
378
+ Entry groups in the import file whose project name does not match the current project, will be ignored (see `dsu project use`).
379
+
380
+ If the `--override` option is used, the import process will ignore the project name found in the import file and import the entries into the current project.
381
+
382
+ EXAMPLES
363
383
 
364
384
  This will import all the DSU entries from the import file, and replace all the entries for the respective entry groups imported:
365
385
 
366
- $ dsu import all -i /path/to/import.csv -m false
386
+ $ dsu import all -m false -i /path/to/import.csv
367
387
 
368
388
  This will import all the DSU entries from the import file, and merge all the entries for the respective entry groups imported:
369
389
 
370
390
  $ dsu import all -i /path/to/import.csv
391
+
392
+ This will import all the DSU entries from the import file, and ignore the project name found in the import file and import the entries into the current project:
393
+
394
+ $ dsu import all -o true -i /path/to/import.csv
371
395
  messages:
372
396
  import_success: Entry group for %{date} imported successfully.
373
- import_error: "Entry group for %{date} imported with an error: %{error}."
397
+ import_error: "Entry group for %{date} imported with an error: %{error}"
398
+ import_error_raised: "The entry groups failed to import. The following error was raised: \"%{error}\"."
374
399
  nothing_to_import: No entry groups to import.
375
400
  cancelled: Cancelled.
376
401
  file_not_exist: Import file %{file_path} does not exist.
377
402
  prompts:
378
- import_all_confirm: Import all entry groups (%{count} entry groups)?
379
- import_dates_confirm: Import all the entry groups for %{from} thru %{to} (%{count} entry groups)?
403
+ import_all_confirm: Import all entry groups (%{count} entry groups) for project "%{project}"?
404
+ project_override_confirm: You have chosen to override the project found in the import file, are you sure you want to continue?
405
+ import_dates_confirm: Import all the entry groups for %{from} thru %{to} (%{count} entry groups) for project "%{project}"?
380
406
  options:
381
- - y
382
- - N
407
+ - Y
408
+ - n
383
409
  list:
384
410
  date:
385
411
  desc: date|d DATE|MNEMONIC
@@ -412,7 +438,7 @@ en:
412
438
 
413
439
  %{mnemonic_option_description}
414
440
 
415
- EXAMPLES:
441
+ EXAMPLES
416
442
 
417
443
  NOTE: All example results are subject to the `--include-all|-a` option.
418
444
 
@@ -472,6 +498,212 @@ en:
472
498
  $ dsu list yesterday
473
499
 
474
500
  $ dsu list y
501
+ project:
502
+ create:
503
+ desc: create|c PROJECT_NAME [PROJECT_DESCRIPTION]
504
+ usage: Creates a dsu project using the given PROJECT_NAME and optional PROJECT_DESCRIPTION
505
+ long_desc: |
506
+ Creates a dsu project using the given PROJECT_NAME and optional PROJECT_DESCRIPTION.
507
+
508
+ dsu project create PROJECT_NAME [PROJECT_DESCRIPTION]
509
+
510
+ dsu p c PROJECT_NAME [PROJECT_DESCRIPTION]
511
+
512
+ PROJECT_NAME
513
+
514
+ The name of the project to create. PROJECT_NAME must be between 2 and 24 characters (inclusive) in length.
515
+
516
+ PROJECT_DESCRIPTION
517
+
518
+ Optional. The description of the project. PROJECT_DESCRIPTION must be between 2 and 32 characters (inclusive) in length. If PROJECT_DESCRIPTION is not provided, the project description will be "<PROJECT_NAME> project" where <PROJECT_NAME> = the name of the project.
519
+
520
+ EXAMPLES
521
+
522
+ $ dsu project create "My project" "My project description"
523
+
524
+ $ dsu p c "My project" "My project description"
525
+
526
+ The below example will create a project called "Alpa" with the description "Alpa project".
527
+
528
+ $ dsu p c "Alpha"
529
+ messages:
530
+ created: Created project "%{project_name}".
531
+ prompts:
532
+ create_confirm: Create project "%{project_name}"?
533
+ create_options:
534
+ - Y
535
+ - n
536
+ use_confirm: Use project "%{project_name}"?
537
+ use_options:
538
+ - Y
539
+ - n
540
+ delete:
541
+ desc: delete|d [PROJECT_NAME|PROJECT_NUMBER]
542
+ usage: Permanently deletes the DSU project indicated by the optional PROJECT_NAME or PROJECT_NUMBER
543
+ long_desc: |
544
+ Permanently deletes the DSU project indicated by given option PROJECT_NAME or PROJECT_NUMBER.
545
+
546
+ dsu project delete [PROJECT_NAME|PROJECT_NUMBER]
547
+
548
+ dsu p d [PROJECT_NAME|PROJECT_NUMBER]
549
+
550
+ PROJECT_NAME
551
+
552
+ The name of the project to delete.
553
+
554
+ PROJECT_NUMBER
555
+
556
+ The number of the project to delete. If PROJECT_NUMBER is used, the project equating to the nth project in the list of projects will be used (see `dsu project list`).
557
+
558
+ NOTES
559
+
560
+ PROJECT_NAME and PROJECT_NUMBER are optional. If neither are provided, the current, default project will be used.
561
+
562
+ EXAMPLES
563
+
564
+ $ dsu project delete "My project"
565
+
566
+ $ dsu p d "My project"
567
+
568
+ The below examples delete the project equating to the nth project in the list of projects (see `dsu project list`).
569
+
570
+ $ dsu project delete 2
571
+
572
+ $ dsu p d 2
573
+
574
+ The below examples delete the current, default project.
575
+
576
+ $ dsu project delete
577
+
578
+ $ dsu p d
579
+ messages:
580
+ deleted: Deleted project "%{project_name}".
581
+ prompts:
582
+ delete_confirm: Delete project "%{project_name} - %{description}"?
583
+ delete_options:
584
+ - Y
585
+ - n
586
+ list:
587
+ desc: list|l
588
+ usage: Lists all the DSU projects
589
+ long_desc: |
590
+ Lists all the DSU projects.
591
+
592
+ dsu project list
593
+
594
+ dsu p l
595
+
596
+ EXAMPLES
597
+
598
+ $ dsu project list
599
+
600
+ $ dsu p l
601
+ rename:
602
+ desc: rename|r PROJECT_NAME|PROJECT_NUMBER NEW_PROJECT_NAME [NEW_PROJECT_DESCRIPTION]
603
+ usage: Renames a dsu project using the given PROJECT_NAME or PROJECT_NUMBER, NEW_PROJECT_NAME and optional NEW_PROJECT_DESCRIPTION
604
+ long_desc: |
605
+ Renames a dsu project using the given PROJECT_NAME or PROJECT_NUMBER, NEW_PROJECT_NAME and optional NEW_PROJECT_DESCRIPTION
606
+
607
+ dsu project rename PROJECT_NAME|PROJECT_NUMBER NEW_PROJECT_NAME [NEW_PROJECT_DESCRIPTION]
608
+
609
+ dsu p r PROJECT_NAME|PROJECT_NUMBER NEW_PROJECT_NAME [NEW_PROJECT_DESCRIPTION]
610
+
611
+ PROJECT_NAME
612
+
613
+ The name of the project to create. PROJECT_NAME must be between 2 and 24 characters (inclusive) in length.
614
+
615
+ PROJECT_NUMBER
616
+
617
+ The number of the project to rename. If PROJECT_NUMBER is used, the project equating to the nth project in the list of projects will be used (see `dsu project list`).
618
+
619
+ NEW_PROJECT_NAME
620
+
621
+ The new name of the project. NEW_PROJECT_NAME must be between 2 and 24 characters (inclusive) in length.
622
+
623
+ NEW_PROJECT_DESCRIPTION
624
+
625
+ Optional. The description of the project. NEW_PROJECT_DESCRIPTION must be between 2 and 32 characters (inclusive) in length. If NEW_PROJECT_DESCRIPTION is not provided, the project description will be "<NEW_PROJECT_NAME> project" where <NEW_PROJECT_NAME> = the name of the project.
626
+
627
+ EXAMPLES
628
+
629
+ $ dsu project rename "My Project" "My New Project" "My new project description"
630
+
631
+ $ dsu p r "My Project" "My New Project" "My new project description"
632
+
633
+ $ dsu project rename 1 "My New Project" "My new project description"
634
+
635
+ $ dsu p r 1 "My New Project" "My new project description"
636
+
637
+ The below example will rename the project called "Alpa" with the "Beta" and add the description "Beta project".
638
+
639
+ $ dsu p r Alpha Beta
640
+ messages:
641
+ # created: Created project "%{project_name}".
642
+ new_project_already_exists: A project for new project name "%{new_project_name}" already exists.
643
+ # project_name_blank: No value provided for project name.
644
+ renamed_project: Renamed project "%{project_name}" to "%{new_project_name}".
645
+ prompts:
646
+ rename_confirm: Rename project "%{project_name}" to "%{new_project_name} - %{new_project_description}"?.
647
+ rename_options:
648
+ - Y
649
+ - n
650
+ use:
651
+ desc: use|u [PROJECT_NAME|PROJECT_NUMBER]
652
+ usage: Selects the DSU project to use, based on the given PROJECT_NAME or PROJECT_NUMBER
653
+ long_desc: |
654
+ Selects the DSU project to use, based on the given PROJECT_NAME or PROJECT_NUMBER.
655
+
656
+ dsu project use [PROJECT_NAME|PROJECT_NUMBER]
657
+
658
+ dsu p u [PROJECT_NAME|PROJECT_NUMBER]
659
+
660
+ PROJECT_NAME
661
+
662
+ The name of the project to use.
663
+
664
+ PROJECT_NUMBER
665
+
666
+ The number of the project to use. If PROJECT_NUMBER is used, the project equating to the nth project in the list of projects will be used (see `dsu project list`).
667
+
668
+ NOTES
669
+
670
+ PROJECT_NAME|PROJECT_NUMBER are optional. The project name or project number of the project to use. If PRONECT_NAME is not provided, the default project will be used. If PROJECT_NUMBER is used, the project equating to the nth project in the list of projects will be used (see `dsu project list`).
671
+
672
+ EXAMPLES
673
+
674
+ These will use the default project.
675
+
676
+ $ dsu project use
677
+
678
+ $ dsu p u
679
+
680
+ These will use the project named "My project".
681
+
682
+ $ dsu project use "My project"
683
+
684
+ $ dsu p u "My project"
685
+
686
+ These will use the 2nd project in the list of projects.
687
+
688
+ $ dsu project use 2
689
+
690
+ $ dsu p u 2
691
+ messages:
692
+ using_project: Now using project "%{project_name}".
693
+ prompts:
694
+ use_confirm: "Use project \"%{project_name} - %{description}\"?"
695
+ use_options:
696
+ - Y
697
+ - n
698
+ messages:
699
+ cancelled: Cancelled.
700
+ does_not_exist: Project "%{project_name}" does not exist.
701
+ no_projects: No projects are available to list.
702
+ number_does_not_exist: A project for number %{project_number} does not exist.
703
+ already_exists: Project "%{project_name}" already exists.
704
+ project_name_blank: No value provided for project name.
705
+ new_project_name_blank: No value provided for new project name.
706
+ already_current_project: Project "%{project_name}" is already the current project.
475
707
  theme:
476
708
  create:
477
709
  desc: create THEME_NAME [OPTIONS]
data/project.bak ADDED
File without changes