Giter VIP home page Giter VIP logo

pl-cli's Introduction

Hi there ๐Ÿ‘‹

I'm Christian. Based in Nevada, USA ๐Ÿ“

Currently a Business Systems Analyst and working on building data projects to start my career in data engineering ๐Ÿ”จ

So far, I've created (and continuing to improve) a end-to-end data engineering project and creating a CLI with Go! ๐ŸŒฑ

What I'm currently learning ๐Ÿง 

Programming Visualization Cloud DevOps Databases
python streamlit cloud docker bigquery
go power-bi github firestore
sql terraform postgres
bash

View my pinned projects ๐Ÿ‘‡

pl-cli's People

Contributors

digitalghost-dev avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

pl-cli's Issues

Separate new flag setup logic

Currently, the flag.NewFlagSet for the standings subcommand is in the main() function. By moving the new flag setup to it's own function, it'll help organize new flag sets in the future.

Create delete option

Create a new file under cmd/ that deletes the standings.csv file.
Set flag options to -d and --delete

Create new standingsflags.go file

When considering the scalability of our project, it would be beneficial to manage the flags for each subcommand in separate configuration files.

Update help message

  • Update help message by using tabs (\t) for spacing.
  • Change usage message to pl-cli [subcommand]

Fix Errorf string

In cmd/delete.go, edit return.Errorf("...") to lowercase and no newline. (ST1005)

Separate flag logic

Separate the functions responsible for the commands into different files. For -s and --standings, this function is moved into standings.go.

Fix module name

Fix the module name in the go.mod file to github.com/digitalghost-dev/premier-league-cli

Rewrite standings.go to read directly from the csv file

Instead of downloading the standings.csv file in order to read the data into a dataframe, read directly from the cloud bucket.

This will replace all current flags (-d, -s, -u) with a single sub-command: pl-cli standings in cli.go

Create better output when asking for help

When running the -h or --help flag, edit the standard output to better display usage.

Example:

Options:
    -s                    Prints current standings
    --standings           Prints current standings

Update usage message

Update the usage message when using the -h or --help flag to reflect changes with the new subcommand: standings

Better format argument checks

The current checks to validate the provided arguments by the user aren't verbose enough to capture every potential case.

Enhancing the small section in the main() function to run through these checks before parsing the commands should help with this:

func main() {

       ...

	// Check the length of provided arguments
	if len(os.Args) < 2 {
            flag.Usage()
	    os.Exit(1)
	} else if len(os.Args) > 3 {
	    standings.Usage()
	    fmt.Println(errorColor.Render("Too many arguments\n"))
	    os.Exit(1)
	}

	// Check whether the provided command is valid
	if os.Args[1] != "standings" {
	    flag.Usage()
            fmt.Println(errorColor.Render("Not a valid command\n"))
	    os.Exit(1)
	}

        ...
}

Better format help output message

Apply formatting when using the -h or --help flag to make the content more legible. Also allow the usage of the -h and --help flag when only running the pl-cli command.

Better format error messages

When the user types too many arguments, an incorrect flag, too few arguments, etc., display an error message with a red color font and describe the exact error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.