syntax-helper

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

README

Maintenance Ask Me Anything ! Documentation Status GitHub issues Awesome Badges License

Syntax Helper CLI

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/.

Installation

Install locally using:

git clone git@github.com:alishalabi/syntax-helper.git

Install using go get command:

go get github.com/alishalabi/syntax-helper

Usage

asciicast

  • Note: All functionality requires broadband connection

Get all Golang functions for given package name:

./syntax-cli golang <pkg-name>

Example:

$ ./syntax-cli 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-cli golang <pkg-name> <function-name>

Example:

$ ./syntax-cli golang unsafe Offsetof
Function Syntax:
func Offsetof(x ArbitraryType) uintptr
For Synatx example:
$ ./syntax-cli golang unsafe Offsetof example

Get example of specific public function from package (Note: function names all begin with a capital letter)

./syntax-cli golang <pkg-name> <function-name> example

Example:

$ ./syntax-cli 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)

}

Contributing

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.

Milestones

  • 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

License

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.

ForTheBadge built-with-love

Documentation

Overview

Package main is the primary entry point of the CLI

Directories

Path Synopsis
Package cmd provides CLI utility
Package cmd provides CLI utility

Jump to

Keyboard shortcuts

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