Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create interface for command line flags #4

Open
artenator opened this issue Oct 28, 2019 · 0 comments
Open

Create interface for command line flags #4

artenator opened this issue Oct 28, 2019 · 0 comments
Assignees

Comments

@artenator
Copy link
Owner

artenator commented Oct 28, 2019

The emulator currently supports logging the output of each NES instruction to stdout, and also to a file. But, the only way to currently do this is to manually alter the code.

There are two functions in main.go

The RunInstruction function takes an instruction and a boolean as arguments, where the boolean defines whether or not to log to stdout.

The initLogOutput() function pipes stdout to a log file.

We should create command line options like --log to pipe instruction output to stdout, and --logfile asdf.log for piping the logs to a file.

Golang provides a simple command line argument parsing package flag.
https://gobyexample.com/command-line-flags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants