Syntax Helper is a CLI that helps developers quickly get access to built-in code syntax. Syntax Helper supports a variety of code packages for both Golang and Python. Data is scrapped directly from https://golang.org/pkg/ & https://docs.python.org/3/library/.
Install locally using:
git clone [email protected]:alishalabi/syntax-helper.git
Install using go get
command:
go get github.com/alishalabi/syntax-helper
- Note: All functionality requires broadband connection
Get all Golang functions for given package name:
./syntax-helper golang <pkg-name>
Example:
$ ./syntax-helper golang unsafe
func Alignof(x ArbitraryType) uintptr
func Offsetof(x ArbitraryType) uintptr
func Sizeof(x ArbitraryType) uintptr
type ArbitraryType
type Pointer
Get syntax for specific public function from package (Note: function names all begin with a capital letter)
./syntax-helper golang <pkg-name> <function-name>
Example:
$ ./syntax-helper golang unsafe Offsetof
Function Syntax:
func Offsetof(x ArbitraryType) uintptr
For Synatx example:
$ ./syntax-helper golang unsafe Offsetof example
Get example of specific public function from package (Note: function names all begin with a capital letter)
./syntax-helper golang <pkg-name> <function-name> example
Example:
$ ./syntax-helper golang fmt Fprintf example
Function Example:
package main
import (
"fmt"
"os"
)
func main() {
const name, age = "Kim", 22
n, err := fmt.Fprintf(os.Stdout, "%s is %d years old.\n", name, age)
// The n and err return values from Fprintf are
// those returned by the underlying io.Writer.
if err != nil {
fmt.Fprintf(os.Stderr, "Fprintf: %v\n", err)
}
fmt.Printf("%d bytes written.\n", n)
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
- Generate skeleton structure
- Implement
Golang
command - Implement
Golang package
parameter - Implement
Golang function
parameter - Implement
Golang function example
parameter - Implement Go-Colly to populate messages
- Implement
Python
command - Implement
Python package
parameter - [] Implement
Python function
parameter - [] Implement
Python function example
parameter - Finalize ReadMe.md
- Implement badges
- [] Deploy as Homebrew package
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.