cynew

command module
v0.0.0-...-f617684 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2020 License: MIT Imports: 8 Imported by: 0

README

cynew

Installation

You can install cynew by the way you prefer.

Release
  1. Download cynew
  2. Add cynew into environment variable PATH
export PATH=$PATH:[folder where you install cynew]
Build

You need install Golang first

  1. Clone the repo
go get github.com/yah01/cynew
  1. Change directory to where cynew exists
cd $GOPATH/src/github.com/yah01/cynew
  1. Run build command
go build
  1. There will be a executable file
  2. Add cynew into environment variable PATH
export PATH=$PATH:[folder where you install cynew]

Usage

simply create a empty file with name hello.cpp
cynew hello.cpp
create more empty files with name first.go, second.json
cynew first.go second.json

Examples above are simple and nothing awesome, they can't show power of cynew. You may want to create a file/folder with some contents (what I call template), you can indicate a template when you create file/folder, cynew will write the contents what the template saving into the file/folder.

create file with template

Maybe you are building a awesome project, and many source code file have some common contents (template my-template):

cynew awesome.go -t my-template

You can create more than one file by just adding more file names

create folder with template

Maybe you used scaffold what creates a folder with some contents (files,folders,... I would call also it template), cynew is a scaffold creator and builder!

cynew my-app -t my-awesome-project

command above will create a folder with name my-app, and fill it with contents what template my-awesome-project saving.

create template with existing file/folder

Now you know how to create file/folder with template, but where is the template? You can create template with cynew easily

cynew -a hello.go

This will create a template with content what hello.go has, then cynew will ask you to input a template name (if you input nothing, the template name is the file name). You can create a folder template by the same way.

flag

  • [-h]: show help information
  • [-ls]: list all template(s)
  • [-t template]: create file/folder with template
  • [-a filename]: add filename into templates (folder is OK)
  • [-d template]: delete template
  • [-i template]: show information of template

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL