Skip to content

Commit

Permalink
Move typeid cli to typeid/ repo (#24)
Browse files Browse the repository at this point in the history
Move the typeid cli to the `typeid` repo, instead of `typeid-go`. This
way, `typeid-go` will be solely for the go library. The top level
`typeid` repo provides a cli tool to generates `typids` from the
command-line. It happens to be written in go, but that's incidental.

This is a tiny PR that I wrote using Devbox Cloud to go through the
whole experience.
  • Loading branch information
loreto committed Jun 14, 2023
1 parent a58ea3a commit 9885c57
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module go.jetpack.io/typeid-cli

go 1.20
19 changes: 19 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import (
"fmt"
"os"

"go.jetpack.io/typeid"
)

func main() {
if len(os.Args) != 2 {
fmt.Println("Usage: typeid [<type_prefix>]")
os.Exit(1)
}

prefix := os.Args[1]
tid := typeid.Must(typeid.New(prefix))
fmt.Println(tid)
}

0 comments on commit 9885c57

Please sign in to comment.