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

Add --list option, and prompt user to open an issue #7

Closed
wants to merge 1 commit into from

Conversation

muan
Copy link
Collaborator

@muan muan commented Jun 14, 2014

Hi @jlord how is this.

$ offline-issues --list

You have these issues:
  1. github-github#1
  2. github-github#2
  3. github-github#3
  4. github-github#4
  5. muan-emoji#1
  6. muan-github-gmail#1

Which issue do you want to open? [1-6] sup
error:   Invalid input for Which issue do you want to open? [1-6]
error:   Must be a number and <=6
Which issue do you want to open? [1-6] 3
Opening ./html/github-github-3.html

I really want issue titles though.

@muan muan changed the title Add --list option, and prompt user to opening an issue Add --list option, and prompt user to open an issue Jun 14, 2014
@jlord
Copy link
Owner

jlord commented Jun 15, 2014

Ok, now I see what you were wanting to do. But I'm wondering, why wouldn't people just:

ls
open filename.html

But also, I'm pretty excited about all the node you did!!!

@dideler
Copy link

dideler commented Jun 15, 2014

Just chiming in from a user's perspective. I would much rather ls and open than be stuck guided in a command interpreter.

Edit: If I were to list my issues, I may not necessarily want to open one. Or I might want to open more than just one. And so on.

P.S. Very excited about this project!

@muan
Copy link
Collaborator Author

muan commented Jun 15, 2014

why wouldn't people just:

ls
open filename.html

Because that'd require me being in the offline-issues folder. And - where is it?!

Edit: If I were to list my issues, I may not necessarily want to open one. Or I might want to open more than just one. And so on.

Simply press either enter or ctrlC will exit the prompt.

@jlord
Copy link
Owner

jlord commented Jun 15, 2014

Because that'd require me being in the offline-issues folder. And - where is it?!

Do you mean the globally installed offline-issues the module folder? You don't need to (and shouldn't) be in that directory. You can run offline-issues from any directory on your computer to fill it with the static files. For example:

cd Desktop
mkdir read-these-issues
cd read-these-issues
offline-issues jlord/offline-issues#7
ls html
# see all the files you have
open filename.html

If I use ls or if I use what you've written, I'm going to have to cd back into Desktop/read-these-issues to get the list of files. Neither will work from anywhere on the system, ie, I can't be in Documents/pictures run your command and be shown the issues I have saved in Desktop/read-these-issues. Also, people can (and may likely) have these stored in many places so that wouldn't make sense anyways.

So in my mind (and with my understanding of this) it adds:

  • a number system and vertical ordering

But in doing so:

  • puts you in a prompt cycle you have to exit

Whereas default ls does nearly same thing, without locking you in a prompt and without numbers and vertical ordering (though if you have lots of issues, maybe numbers/list would be nice, see last paragraph):

screen shot 2014-06-15 at 10 58 57 am

The user doesn't have to use the --list option so it won't hurt to put it in. I'm probably going to stick with ls myself because it's more muscle memory and does nearly the same thing.

Anyway, I don't mind putting it in since it's optional and already written but I just wanted to surface this stuff @muan so that it's clear about what it is/isn't doing.

😻


module.exports = function listofissues(cb) {
fs.readdir(path, function(err, files) {
var num = files.length
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to handle the err here:

if (err) return cb(err, "Error reading directory")

@muan muan closed this Jun 15, 2014
@jlord jlord mentioned this pull request Jun 15, 2014
10 tasks
@jlord
Copy link
Owner

jlord commented Jun 15, 2014

@muan Do you think it would be possible to show offline-issue instances across multiple directories? Like if we had a hidden . file in the directory to identify it and could search for that?

@muan
Copy link
Collaborator Author

muan commented Jun 15, 2014

So what I thought happen was all files get stored in the directory where the module is, but apparently I was wrong, seems like files get stored at whichever directory you were in, so never mind. lol
I definitely didn't mean for it to do exactly what ls open can do.

Such node. Much to learn.

@muan muan deleted the muan/list-of-issues branch June 16, 2014 16:35
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

Successfully merging this pull request may close these issues.

3 participants