Skip to content

Commit db1e472

Browse files
committed
Fix version flag bug, add dist shell scripts
1 parent c62b728 commit db1e472

5 files changed

Lines changed: 84 additions & 47 deletions

File tree

.repoinfo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version 0.2.0

LICENSE.org renamed to LICENSE.md

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
* GNU GENERAL PUBLIC LICENSE
2-
3-
Copyright (C) 2025 Will Reed
1+
# GNU GENERAL PUBLIC LICENSE
2+
Version 3
3+
Copyright (C) 2025 Will Reed <wreed@disroot.org>
4+
<https://fsf.org/>
45

56
Everyone is permitted to copy and distribute verbatim copies of this
67
license document, but changing it is not allowed.
78

8-
** Preamble
9+
## Preamble
910

1011
The GNU General Public License is a free, copyleft license for
1112
software and other kinds of works.
@@ -70,9 +71,9 @@ assures that patents cannot be used to render the program non-free.
7071
The precise terms and conditions for copying, distribution and
7172
modification follow.
7273

73-
** TERMS AND CONDITIONS
74+
## TERMS AND CONDITIONS
7475

75-
*** 0. Definitions.
76+
### 0. Definitions.
7677

7778
"This License" refers to version 3 of the GNU General Public License.
7879

@@ -112,7 +113,7 @@ work under this License, and how to view a copy of this License. If
112113
the interface presents a list of user commands or options, such as a
113114
menu, a prominent item in the list meets this criterion.
114115

115-
*** 1. Source Code.
116+
### 1. Source Code.
116117

117118
The "source code" for a work means the preferred form of the work for
118119
making modifications to it. "Object code" means any non-source form of
@@ -153,7 +154,7 @@ regenerate automatically from other parts of the Corresponding Source.
153154
The Corresponding Source for a work in source code form is that same
154155
work.
155156

156-
*** 2. Basic Permissions.
157+
### 2. Basic Permissions.
157158

158159
All rights granted under this License are granted for the term of
159160
copyright on the Program, and are irrevocable provided the stated
@@ -178,7 +179,7 @@ Conveying under any other circumstances is permitted solely under the
178179
conditions stated below. Sublicensing is not allowed; section 10 makes
179180
it unnecessary.
180181

181-
*** 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
182+
### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
182183

183184
No covered work shall be deemed part of an effective technological
184185
measure under any applicable law fulfilling obligations under article
@@ -194,7 +195,7 @@ operation or modification of the work as a means of enforcing, against
194195
the work's users, your or third parties' legal rights to forbid
195196
circumvention of technological measures.
196197

197-
*** 4. Conveying Verbatim Copies.
198+
### 4. Conveying Verbatim Copies.
198199

199200
You may convey verbatim copies of the Program's source code as you
200201
receive it, in any medium, provided that you conspicuously and
@@ -207,7 +208,7 @@ recipients a copy of this License along with the Program.
207208
You may charge any price or no price for each copy that you convey,
208209
and you may offer support or warranty protection for a fee.
209210

210-
*** 5. Conveying Modified Source Versions.
211+
### 5. Conveying Modified Source Versions.
211212

212213
You may convey a work based on the Program, or the modifications to
213214
produce it from the Program, in the form of source code under the
@@ -242,7 +243,7 @@ beyond what the individual works permit. Inclusion of a covered work
242243
in an aggregate does not cause this License to apply to the other
243244
parts of the aggregate.
244245

245-
*** 6. Conveying Non-Source Forms.
246+
### 6. Conveying Non-Source Forms.
246247

247248
You may convey a covered work in object code form under the terms of
248249
sections 4 and 5, provided that you also convey the machine-readable
@@ -338,7 +339,7 @@ documented (and with an implementation available to the public in
338339
source code form), and must require no special password or key for
339340
unpacking, reading or copying.
340341

341-
*** 7. Additional Terms.
342+
### 7. Additional Terms.
342343

343344
"Additional permissions" are terms that supplement the terms of this
344345
License by making exceptions from one or more of its conditions.
@@ -397,7 +398,7 @@ Additional terms, permissive or non-permissive, may be stated in the
397398
form of a separately written license, or stated as exceptions; the
398399
above requirements apply either way.
399400

400-
*** 8. Termination.
401+
### 8. Termination.
401402

402403
You may not propagate or modify a covered work except as expressly
403404
provided under this License. Any attempt otherwise to propagate or
@@ -425,7 +426,7 @@ this License. If your rights have been terminated and not permanently
425426
reinstated, you do not qualify to receive new licenses for the same
426427
material under section 10.
427428

428-
*** 9. Acceptance Not Required for Having Copies.
429+
### 9. Acceptance Not Required for Having Copies.
429430

430431
You are not required to accept this License in order to receive or run
431432
a copy of the Program. Ancillary propagation of a covered work
@@ -436,7 +437,7 @@ modify any covered work. These actions infringe copyright if you do
436437
not accept this License. Therefore, by modifying or propagating a
437438
covered work, you indicate your acceptance of this License to do so.
438439

439-
*** 10. Automatic Licensing of Downstream Recipients.
440+
### 10. Automatic Licensing of Downstream Recipients.
440441

441442
Each time you convey a covered work, the recipient automatically
442443
receives a license from the original licensors, to run, modify and
@@ -461,7 +462,7 @@ rights granted under this License, and you may not initiate litigation
461462
any patent claim is infringed by making, using, selling, offering for
462463
sale, or importing the Program or any portion of it.
463464

464-
*** 11. Patents.
465+
### 11. Patents.
465466

466467
A "contributor" is a copyright holder who authorizes use under this
467468
License of the Program or a work on which the Program is based. The
@@ -530,7 +531,7 @@ Nothing in this License shall be construed as excluding or limiting
530531
any implied license or other defenses to infringement that may
531532
otherwise be available to you under applicable patent law.
532533

533-
*** 12. No Surrender of Others' Freedom.
534+
### 12. No Surrender of Others' Freedom.
534535

535536
If conditions are imposed on you (whether by court order, agreement or
536537
otherwise) that contradict the conditions of this License, they do not
@@ -543,7 +544,7 @@ from those to whom you convey the Program, the only way you could
543544
satisfy both those terms and this License would be to refrain entirely
544545
from conveying the Program.
545546

546-
*** 13. Use with the GNU Affero General Public License.
547+
### 13. Use with the GNU Affero General Public License.
547548

548549
Notwithstanding any other provision of this License, you have
549550
permission to link or combine any covered work with a work licensed
@@ -554,7 +555,7 @@ but the special requirements of the GNU Affero General Public License,
554555
section 13, concerning interaction through a network will apply to the
555556
combination as such.
556557

557-
*** 14. Revised Versions of this License.
558+
### 14. Revised Versions of this License.
558559

559560
The Free Software Foundation may publish revised and/or new versions
560561
of the GNU General Public License from time to time. Such new versions
@@ -580,7 +581,7 @@ permissions. However, no additional obligations are imposed on any
580581
author or copyright holder as a result of your choosing to follow a
581582
later version.
582583

583-
*** 15. Disclaimer of Warranty.
584+
### 15. Disclaimer of Warranty.
584585

585586
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
586587
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
@@ -592,7 +593,7 @@ PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
592593
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
593594
CORRECTION.
594595

595-
*** 16. Limitation of Liability.
596+
### 16. Limitation of Liability.
596597

597598
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
598599
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
@@ -604,7 +605,7 @@ LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
604605
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
605606
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
606607

607-
*** 17. Interpretation of Sections 15 and 16.
608+
### 17. Interpretation of Sections 15 and 16.
608609

609610
If the disclaimer of warranty and limitation of liability provided
610611
above cannot be given local legal effect according to their terms,
@@ -615,7 +616,7 @@ copy of the Program in return for a fee.
615616

616617
END OF TERMS AND CONDITIONS
617618

618-
** How to Apply These Terms to Your New Programs
619+
## How to Apply These Terms to Your New Programs
619620

620621
If you develop a new program, and you want it to be of the greatest
621622
possible use to the public, the best way to achieve this is to make it
@@ -669,4 +670,4 @@ program into proprietary programs. If your program is a subroutine
669670
library, you may consider it more useful to permit linking proprietary
670671
applications with the library. If this is what you want to do, use the
671672
GNU Lesser General Public License instead of this License. But first,
672-
please read <https://www.gnu.org/licenses/why-not-lgpl.html>.
673+
please read <https://www.gnu.org/licenses/why-not-lgpl.html>.

Sources/main.swift

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,10 @@ import struct ArgumentParser.Option
88
import struct ArgumentParser.CommandConfiguration
99

1010
let esc_reset: String = "\u{1B}[0m";
11-
let current_version: String = "0.1.0";
11+
let current_version: String = "0.3.0";
1212

1313
typealias ColorPalette = [(name: String, hex: String, rgb: [Int], hsl: [Int], hwb: [Int])];
1414

15-
// func term_truecolor() -> Bool
16-
// {
17-
// if let value = ProcessInfo.processInfo.environment["COLORTERM"] {
18-
// switch value {
19-
// // Env var is set to 'truecolor'
20-
// case "truecolor":
21-
// return(true);
22-
// // Env var found, but not set to 'truecolor'
23-
// default:
24-
// return(false);
25-
// }
26-
27-
// } else {
28-
// // Env var isn't set
29-
// return(false);
30-
// }
31-
// }
32-
33-
// let is_truecolorterm: Bool = term_truecolor();
34-
3515
let palette_base: ColorPalette = [
3616
( /* base: foreground */
3717
name: "foreground",
@@ -607,6 +587,10 @@ struct Alice: ParsableCommand
607587
var helpColorNames: Bool = false;
608588

609589
mutating func run() throws {
590+
if showVersion {
591+
usage_version();
592+
}
593+
610594
if helpColorNames {
611595
help_colorNames();
612596
}
@@ -644,4 +628,4 @@ struct Alice: ParsableCommand
644628
action_print(out: full_colors);
645629
}
646630
}
647-
}
631+
}

scripts/make-dist.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/sh
2+
3+
version="$(head -n1 $PWD/.repoinfo | cut -d' ' -f2)"
4+
5+
mkdir "alice-${version}"
6+
d="alice-${version}"
7+
8+
binary="./.build/release/alice"
9+
10+
install -Dvm 0644 LICENSE.md "${d}/share/licenses/alice/LICENSE.md"
11+
scdoc < doc/alice.1.scd > doc/alice.1
12+
install -Dvm 0644 doc/alice.1 "${d}/share/man/man1/alice.1"
13+
install -Dvm 0755 "${binary}" "${d}/bin/alice"
14+
strip --strip-all "${d}/bin/alice"
15+
install -vd "${d}/share/bash-completion/completions"
16+
install -vd "${d}/share/fish/vendor_completions.d"
17+
install -vd "${d}/share/zsh/site-functions"
18+
"${d}/bin/alice" --generate-completion-script bash > "${d}/share/bash-completion/completions/alice"
19+
"${d}/bin/alice" --generate-completion-script zsh > "${d}/share/zsh/site-functions/_alice"
20+
"${d}/bin/alice" --generate-completion-script fish > "${d}/share/fish/vendor_completions.d/alice.fish"
21+
22+
tar -f "${d}.tar" \
23+
--no-same-owner \
24+
--no-same-permissions \
25+
--no-xattrs \
26+
--no-selinux \
27+
-v --create "${d}"
28+
29+
gzip --rsyncable --verbose -n "${d}.tar"

scripts/make-src-dist.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/sh
2+
3+
version="$(head -n1 $PWD/.repoinfo | cut -d' ' -f2)"
4+
5+
mkdir "alice-${version}-src"
6+
d="alice-${version}-src"
7+
8+
set "Sources" "doc" "scripts" "tests" ".editorconfig" ".repoinfo" "LICENSE.md" "Package.swift" "README.org" "justfile"
9+
10+
for item in $@
11+
do
12+
cp -arv "${item}" "${d}/${item}"
13+
done
14+
15+
tar -f "${d}.tar" \
16+
--no-same-owner \
17+
--no-same-permissions \
18+
--no-xattrs \
19+
--no-selinux \
20+
-v --create "${d}"
21+
22+
gzip --rsyncable --verbose -n "${d}.tar"

0 commit comments

Comments
 (0)