Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add an option to choose an ASCII font #44

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

cpanato
Copy link
Member

@cpanato cpanato commented Mar 28, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • add an option to choose an ASCII font
    the lib we use to print ASCII fonts has several fonts available to use right away.
    So we can enable that when configuring the version in the application

For example:

[fonts/italic.flf fonts/smisome1.flf fonts/tinker-toy.flf fonts/basic.flf fonts/cricket.flf fonts/elite.flf fonts/puffy.flf fonts/shadow.flf fonts/smslant.flf fonts/maxfour.flf fonts/roman.flf fonts/rozzo.flf fonts/smtengwar.flf fonts/big.flf fonts/chunky.flf fonts/linux.flf fonts/stampatello.flf fonts/avatar.flf fonts/nipples.flf fonts/relief2.flf fonts/doh.flf fonts/doom.flf fonts/eftirobot.flf fonts/smshadow.flf fonts/usa
flag.flf fonts/3-d.flf fonts/alligator.flf fonts/caligraphy.flf fonts/drpepper.flf fonts/goofy.flf fonts/kban.flf fonts/mike.flf fonts/mirror.flf fonts/barbwire.flf fonts/catwalk.flf fonts/cybermedium.flf fonts/rounded.flf fonts/script.flf fonts/ticksslant.flf fonts/nancyj-underlined.flf fonts/slscript.flf fonts/standard.flf fonts/tengwar.flf fonts/eftiwall.flf fonts/fourtops.flf fonts/letters.flf fonts/diamond.flf fonts/gra
ffiti.flf fonts/relief.flf fonts/eftifont.flf fonts/pebbles.flf fonts/rowancap.flf fonts/lean.flf fonts/nancyj.flf fonts/lockergnome.flf fonts/runyc.flf fonts/slide.flf fonts/tanja.flf fonts/bubble.flf fonts/contessa.flf fonts/isometric4.flf fonts/smscript.flf fonts/thin.flf fonts/alphabet.flf fonts/binary.flf fonts/rectangles.flf fonts/threepoint.flf fonts/alligator2.flf fonts/ivrit.flf fonts/morse.flf fonts/jerusalem.flf f
onts/ntgreek.flf fonts/peaks.flf fonts/block.flf fonts/cosmike.flf fonts/epic.flf fonts/eftipiti.flf fonts/fuzzy.flf fonts/speed.flf fonts/banner3-D.flf fonts/cosmic.flf fonts/digital.flf fonts/ticks.flf fonts/eftitalic.flf fonts/smkeyboard.flf fonts/straight.flf fonts/weird.flf fonts/banner3.flf fonts/short.flf fonts/small.flf fonts/bell.flf fonts/dotmatrix.flf fonts/twopoint.flf fonts/wavy.flf fonts/contrast.flf fonts/o8.f
lf fonts/trek.flf fonts/pawp.flf fonts/tsalagi.flf fonts/bigchief.flf fonts/hollywood.flf fonts/isometric3.flf fonts/5lineoblique.flf fonts/pyramid.flf fonts/bulbhead.flf fonts/eftichess.flf fonts/runic.flf fonts/starwars.flf fonts/3x5.flf fonts/coinstak.flf fonts/ogre.flf fonts/moscow.flf fonts/cybersmall.flf fonts/larry3d.flf fonts/lcd.flf fonts/marquee.flf fonts/nancyj-fancy.flf fonts/stellar.flf fonts/computer.flf fonts/
cursive.flf fonts/jazmine.flf fonts/colossal.flf fonts/rot13.flf fonts/thick.flf fonts/serifcap.flf fonts/term.flf fonts/tombstone.flf fonts/eftiwater.flf fonts/gothic.flf fonts/isometric1.flf fonts/mnemonic.flf fonts/poison.flf fonts/banner.flf fonts/cyberlarge.flf fonts/katakana.flf fonts/rev.flf fonts/slant.flf fonts/stop.flf fonts/calgphy2.flf fonts/invita.flf fonts/madrid.flf fonts/isometric2.flf fonts/mini.flf fonts/pe
pper.flf fonts/sblood.flf fonts/univers.flf fonts/acrobatic.flf fonts/banner4.flf fonts/fender.flf]

in real usage:

...
func init() {
	rootCmd.AddCommand(version.Version("starwars"))
}
...
$ ./ascii version
  ______   ______        _______. __    _______ .__   __.
 /      | /  __  \      /       ||  |  /  _____||  \ |  |
|  ,----'|  |  |  |    |   (----`|  | |  |  __  |   \|  |
|  |     |  |  |  |     \   \    |  | |  | |_ | |  . `  |
|  `----.|  `--'  | .----)   |   |  | |  |__| | |  |\   |
 \______| \______/  |_______/    |__|  \______| |__| \__|
cosign

GitVersion:    (devel)
GitCommit:     unknown
GitTreeState:  unknown
BuildDate:     unknown
GoVersion:     go1.18
Compiler:      gc
Platform:      darwin/arm64

using an invalid font name

$ ./ascii version
font not valid, using default
   ____    ___    ____    ___    ____   _   _
  / ___|  / _ \  / ___|  |_ _|  / ___| | \ | |
 | |     | | | | \___ \   | |  | |  _  |  \| |
 | |___  | |_| |  ___) |  | |  | |_| | | |\  |
  \____|  \___/  |____/  |___|  \____| |_| \_|
cosign

GitVersion:    (devel)
GitCommit:     unknown
GitTreeState:  unknown
BuildDate:     unknown
GoVersion:     go1.18
Compiler:      gc
Platform:      darwin/arm64

/assign @saschagrunert @n3wscott @puerco

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?

add an option to choose an ASCII font

@cpanato cpanato requested a review from n3wscott March 28, 2022 07:42
@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 28, 2022
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 28, 2022
@k8s-ci-robot k8s-ci-robot added the sig/release Categorizes an issue or PR as relevant to SIG Release. label Mar 28, 2022
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 28, 2022
Signed-off-by: cpanato <ctadeu@gmail.com>
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cpanato, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [cpanato,saschagrunert]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 66f8709 into kubernetes-sigs:main Mar 28, 2022
@cpanato cpanato deleted the add-option-font branch March 28, 2022 08:08
Copy link
Member

@puerco puerco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heheh I love this! This is fun stuff!

but, there is one problem...

version/command.go Show resolved Hide resolved
@cpanato cpanato mentioned this pull request Mar 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/release Categorizes an issue or PR as relevant to SIG Release. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants